If a class has at least one abstract method, the class must be?

Get ready for your Object‑Oriented Programming Test. Use flashcards and multiple-choice questions. Each question includes hints and explanations. Prepare for your exam today!

Multiple Choice

If a class has at least one abstract method, the class must be?

Explanation:
When a class includes at least one abstract method, it must be declared abstract. An abstract method has no implementation, so the class isn’t complete on its own and cannot be instantiated. Declaring the class as abstract communicates that subclasses will provide concrete implementations for the abstract methods, while the abstract class can still offer implemented methods to share common behavior. This is exactly why the correct option specifies the class as abstract. Think of interfaces as a different construct used to define a contract; a class with an abstract method is not an interface. A final class cannot be abstract because final prevents subclassing, and abstract methods require subclassing to provide implementations. Static relates to members or nested classes, not to whether a class must be abstract.

When a class includes at least one abstract method, it must be declared abstract. An abstract method has no implementation, so the class isn’t complete on its own and cannot be instantiated. Declaring the class as abstract communicates that subclasses will provide concrete implementations for the abstract methods, while the abstract class can still offer implemented methods to share common behavior. This is exactly why the correct option specifies the class as abstract.

Think of interfaces as a different construct used to define a contract; a class with an abstract method is not an interface. A final class cannot be abstract because final prevents subclassing, and abstract methods require subclassing to provide implementations. Static relates to members or nested classes, not to whether a class must be abstract.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy