What is an abstract method?

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

What is an abstract method?

Explanation:
Abstract methods declare the method signature without providing an implementation. They establish a contract that subclasses must fulfill by supplying concrete code for that method. The containing class is usually declared abstract, and you can’t instantiate it until all abstract methods are implemented by a subclass. This is why the best description is a method that is declared with the abstract keyword and has no body. If a method has an empty body, it’s still a concrete method with a (potentially no-op) implementation, not abstract. A static method belongs to the class itself and can have an implementation, and a method with default implementation is simply a regular, concrete method.

Abstract methods declare the method signature without providing an implementation. They establish a contract that subclasses must fulfill by supplying concrete code for that method. The containing class is usually declared abstract, and you can’t instantiate it until all abstract methods are implemented by a subclass. This is why the best description is a method that is declared with the abstract keyword and has no body. If a method has an empty body, it’s still a concrete method with a (potentially no-op) implementation, not abstract. A static method belongs to the class itself and can have an implementation, and a method with default implementation is simply a regular, concrete method.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy