What is an abstract class in Java?

Java MCQ: What is an abstract class in Java?

a) A class that cannot be instantiated
b) A class with all abstract methods
c) A class that can be instantiated
d) A class without methods

Answer:

a) A class that cannot be instantiated

Explanation:

An abstract class in Java is a class that cannot be instantiated on its own and is meant to be subclassed. It may contain abstract methods, which are methods without implementations, as well as concrete methods.

Understanding abstract classes is important for designing flexible and extendable Java applications, where certain behaviors are defined in a superclass and implemented in subclasses.

Reference links:

https://www.rameshfadatare.com/learn-java-programming/
https://www.javaguides.net/p/java-tutorial-learn-java-programming.html

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top