java - Changing the return value of a method -
this code asserting created class' method returns value returns right number. have insert own code [???]
currently.
class { int m() { return 1; } } public class exercise { public static void main(string [] arg) { a = [???]; assert a.m() == 2; } }
how change return value of m
method of class returns 2, not 1?
i suppose need this:
a = new a() { @override int m() {return 2;} };
Comments
Post a Comment