Given: What is the result?
A.
Initialized Started
B.
Initialized Started Initialized
C.
Compilation fails
D.
An exception is thrown at runtime
Given: What is the result?
A.
Initialized Started
B.
Initialized Started Initialized
C.
Compilation fails
D.
An exception is thrown at runtime
C. Compilaton fails is the correct answer because private void init() is not accessible outside the class in which it is defined, so c.init() will produce a compilation error.
If you remove c.init() from the code then it would work and print:
Initialized
Started
Agree. I get the same results. Which leaves me very confused why everyone is answering this as B.
c
Answer: C