181k views
2 votes
An abstract class can have only concrete methods (no abstract method). True False

User Mjuopperi
by
7.4k points

1 Answer

5 votes

Final answer:

An abstract class can have concrete and abstract methods.

Step-by-step explanation:

An abstract class can have concrete methods, but it can also have abstract methods. Abstract methods are declared without an implementation, allowing subclasses to provide their own implementation. Concrete methods, on the other hand, have a defined implementation in the abstract class itself.

For example, consider an abstract class called 'Shape' with a concrete method called 'draw'. The 'draw' method would have a specific implementation in the 'Shape' class, while the subclasses, such as 'Circle' or 'Rectangle', would override the abstract methods and provide their own implementation.

Therefore, the statement 'An abstract class can have only concrete methods (no abstract method)' is False.

User Jordanperry
by
7.7k points