What happens as a result of compiling and running the following code:

public class Bar extends Foo {               // 1
    public static void main(String[] args) { // 2
        System.out.print(sum(1, 2));         // 3
    }
}
class Foo {
    int sum(int x, int y) {
        return x + y;
    }
}

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback