menu

Java Classes and Objects

Java Classes and Objects - Important Points


16. Which of the following is true about abstract classes in Java?

A. They cannot have constructors.

B. They can be instantiated.

C. They can have both abstract and non-abstract methods.

D. They cannot have any methods implemented.

Discuss Work Space

Answer: option c

Explanation:

Abstract classes can have both abstract and non-abstract methods.

17. Which of the following is true about interfaces in Java?

A. They can have instance variables.

B. They can be instantiated.

C. They can have both abstract and non-abstract methods.

D. They can have constructors.

Discuss Work Space

Answer: option c

Explanation:

Interfaces can have both abstract and non-abstract methods.

18. Which keyword is used to implement inheritance in Java?

A. extends

B. implements

C. super

D. this

Discuss Work Space

Answer: option a

Explanation:

The extends keyword is used to implement inheritance in Java.

19. Which of the following is true about the Object class in Java?

A. It is the parent class of all other classes in Java.

B. It is an abstract class.

C. It provides default implementations for several methods.

D. All of the above.

Discuss Work Space

Answer: option d

Explanation:

The Object class is the parent class of all other classes in Java, it is an abstract class, and it provides default implementations for several methods.

20. Which of the following is not a characteristic of a well-designed class in Java?

A. It should be easy to understand and use.

B. It should have a single responsibility.

C. It should be tightly coupled with other classes.

D. It should be easy to maintain and extend.

Discuss Work Space

Answer: option c

Explanation:

A well-designed class in Java should not be tightly coupled with other classes. It should have a single responsibility, be easy to understand and use, and be easy to maintain and


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