Revature Interview Practice Test

Session length

1 / 20

What is the primary characteristic of abstract classes?

They can be instantiated directly

They contain implemented methods only

They cannot be instantiated and may contain abstract methods

The primary characteristic of abstract classes is that they cannot be instantiated, meaning you cannot create an object directly from an abstract class. This is a fundamental concept in object-oriented programming that allows abstract classes to serve as blueprints for subclasses. Abstract classes may contain abstract methods, which are declarations of methods that do not include implementation. This means that any concrete subclass inheriting from the abstract class is required to provide implementations for these abstract methods.

Additionally, abstract classes can contain implemented methods as well, which are concrete methods that the subclasses can inherit or override. This combination allows for a high degree of flexibility and abstraction, enabling developers to define a base class that provides common functionality while requiring specific behavior to be defined in derived classes. Subclasses can use the implemented methods directly while ensuring that the abstract methods are implemented according to their specific needs.

The characteristic of not being able to instantiate directly ensures that the abstract class provides a framework for subclasses, fostering a strong hierarchy and code reusability in the design of applications.

They have no relation to subclasses

Next Question
Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy