Given the following code:
What is the output?
The object referenced by cobj is an instance of C, which is also an instance of B. Therefore v.mB() executes, followed by v1.mC() after the nested instanceof C test succeeds. The output is mBmC.
cobj
C
B
v.mB()
v1.mC()
instanceof C
mBmC
Community Discussion