Type Here to Get Search Results !

What does it mean when we say a class is an "abstract class"?

0

 What does it mean when we say a class is an "abstract class"?

A) It can be instantiated.
B) It cannot be instantiated and may contain abstract methods.
C) It is a class that cannot have any properties.
D) It is a class with only static methods.

Answer: B) It cannot be instantiated and may contain abstract methods.

Explanation: An abstract class serves as a blueprint for other classes. It cannot be instantiated directly, meaning you cannot create an object of an abstract class. It can include abstract methods (methods without an implementation) that must be implemented by derived (child) classes. This allows for a common interface while enforcing certain behaviors in the subclasses.

Post a Comment

0 Comments