Kizspy | Question: 28 (Choose 1 answer)
class A {
What will be the output of the following Java code?
int a = 5;public int getA() {
return a;
} } //class A
class B extends A {
private int a = 6;
public void rollBackA() {
a++;
a = super.getA();
}
}//class B public class Main {
public static void main(String[] args) {
A objA= new A();
B objB = new B();
objB.rollBackA();
System.out.format("%d %d%n", objA.getA(), objB.getA());
}
}
A. 5,5
B. 6,6
C. 5,6
D. 6,5
FUOV