Return to site

JAVA CERTIFICATION QUESTION: Overriding methods in Java

· java,ocp

This quiz’s code is deliberately designed to hint that the question is about one thing.

However, this question actually investigates something else.

Given these two classes:

What is the result if you try to compile and run the code? Choose one.

A. 0

B. 1

C. 2

D. Compilation of the Product class fails.

E. The main method throws an exception during runtime.

 

 

 

·ꓷ uoᴉʇdo sᴉ ɹǝʍsuɐ ʇɔǝɹɹoɔ ǝɥꓕ ·uoᴉsnʅɔuoꓛ