menu

Inheritance in Java

Inheritance in Java - Important Points


11. Which keyword is used to create an abstract class in Java?

A. abstract

B. final

C. static

D. synchronized

Discuss Work Space

Answer: option a

Explanation:

The 'abstract' keyword is used to create an abstract class in Java.

12. Which type of inheritance is a combination of single and multiple inheritance?

A. Hybrid inheritance

B. Multiple inheritance

C. Hierarchical inheritance

D. Multilevel inheritance

Discuss Work Space

Answer: option a

Explanation:

Hybrid inheritance is a combination of single and multiple inheritance.

13. Which of the following is NOT a benefit of inheritance?

A. Reusability of code

B. Increased complexity of code

C. Polymorphism

D. Reduced development time

Discuss Work Space

Answer: option b

Explanation:

Increased complexity of code is not a benefit of inheritance.

14. Which method of the Object class is used to compare two objects for equality

A. hashCode()

B. equals()

C. toString()

D. getClass()

Discuss Work Space

Answer: option b

Explanation:

The 'equals()' method of the Object class is used to compare two objects for equality.

15. Which keyword is used to create an interface in Java?

A. abstract

B. interface

C. implements

D. extends

Discuss Work Space

Answer: option b

Explanation:

The 'interface' keyword is used to create an interface in Java.


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