1.

Which of these keywords can be used to prevent inheritance of a class?(a) super(b) constant(c) class(d) finalThis question was posed to me during an internship interview.The origin of the question is The Object Class topic in portion Inheritance of Java

Answer»

The correct CHOICE is (d) final

For EXPLANATION I would say: Declaring a CLASS final implicitly declared all of its methods final, and MAKES the class INHERITABLE.



Discussion

No Comment Found

Related InterviewSolutions