Practice Test Geeks home

1Z0-811 Java Class Design

What is the result of attempting to compile and run the following code?
class A {

public void method() {

System.out.println("A"); ,

}

}

class B extends A {

public void method() {

System.out.println("B");

}

}

public class Test {

public static void main(String[] args) {

A obj = new B();

obj.method();

}

}

Select your answer