Kizspy | Question: 15
(Choose 1 answer)
What will be the output of the following code snippet?
class A {
static void print() {
System.out.println("Class A");
class B extends A {
static void print() {
System.out.println("Class B");
public class Test {
public static void main(String[] args) {
A obj = new B();
obj.print();
A. Class A
B. Class B
C. Compilation error
D. Runtime error