You are on page 1of 1

02.

QID - 2.1320

What will the following code print when compiled and run?
class ABCD{
int x = 10;
static int y = 20;
}
class MNOP extends ABCD{
int x = 30;
static int y = 40;
}
public class TestClass {
public static void main(String[] args) {
System.out.println(new MNOP().x+", "+new MNOP().y);
}
}

Select 1 option
A. 10, 40

B. 30, 20

C. 10, 20

D. 30, 40

E. 20, 30
F. Compilation error.

You might also like