In Java, can an abstract class extend another class?
A. No, abstract classes cannot extend other classes
B. Yes, abstract classes can extend both abstract and concrete classes
C. Only if the superclass is marked as "static"
D. Only if the subclass is marked as "final"
Answer: Option B
Solution (By Examveda Team)
In Java, abstract classes can extend both abstract and concrete classes.When an abstract class extends another class (whether abstract or concrete), it inherits the properties and methods of that class.
An abstract class is allowed to inherit from a concrete class and can override or use the methods from the superclass.
Option A is incorrect because abstract classes can extend other classes.
Option C is incorrect since there is no requirement for the superclass to be marked as "static."
Option D is incorrect as the subclass does not need to be marked "final" to extend a class.
Join The Discussion
Comments (1)
A. A contract specifying a set of methods that a class must implement
B. A class that cannot be instantiated
C. A class that contains only static methods
D. A subclass of the Object class
In Java, can a class implement multiple interfaces?
A. Interfaces cannot be implemented by classes
B. Only abstract classes can implement interfaces
C. No, a class can only implement one interface
D. Yes, a class can implement multiple interfaces
What is the purpose of an abstract class in Java?
A. To declare abstract methods
B. To provide a base class with common methods and fields
C. To make a class final
D. None of These

wrong the correct answer would be B