Which three values will appear in the output?

Given:

Which three values will appear in the output?

Given:

Which three values will appear in the output?

A.
5

B.
7

C.
a1

D.
a2

E.
b1

F.
b2

Explanation:

Staticmethod of base class is invoked >>
A myA = new B();
System.out.print(myA.doA() + myA.doA2() + myA.a);
class B String doA() { return “b1 “; }
class A protected static String doA2 () { return “a2 “; }

class B int a = 7;



Leave a Reply 1

Your email address will not be published. Required fields are marked *


mknet

mknet

b1a25 >> A,D,E >> static methods and instance variables can not be overridden