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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -