menu

Inheritance in Java

Inheritance in Java - Important Points


6. Which method of the Object class is called when an object is no longer referenced?

A. finalize()

B. delete()

C. destroy()

D. dispose()

Discuss Work Space

Answer: option a

Explanation:

The 'finalize()' method of the Object class is called when an object is no longer referenced.

7. What is the name of the process of creating a new class by extending an existing class?

A. Abstraction

B. Polymorphism

C. Inheritance

D. Encapsulation

Discuss Work Space

Answer: option c

Explanation:

Inheritance is the process of creating a new class by extending an existing class.

8. Which keyword is used to invoke the constructor of the parent class?

A. this

B. super

C. extends

D. implements

Discuss Work Space

Answer: option b

Explanation:

The 'super' keyword is used to invoke the constructor of the parent class.

9. Which of the following is NOT a type of inheritance in Java?

A. Single inheritance

B. Multiple inheritance

C. Hybrid inheritance

D. Hierarchical inheritance

Discuss Work Space

Answer: option c

Explanation:

Hybrid inheritance is not a type of inheritance in Java.

10. Which method of the Object class is used to return a hash code value for an object?

A. hashCode()

B. equals()

C. toString()

D. getClass()

Discuss Work Space

Answer: option a

Explanation:

The 'hashCode()' method of the Object class is used to return a hash code value for an object.


Subscribe for Latest Career Trends
Subscribe Now
Use AI and ChatGPT for Career Guidance

Unlock Your Future

Join Now
Worried for Placements in 2024?

Join FAST TRACK Course

Join Now
Supercharge Your SUCCESS

Join All in One Placement Mock Tests-2024

Join Now