Which statement is true about abstract classes?

Master Kotlin and Android with our engaging quizzes. Test your knowledge with multiple choice questions and detailed explanations. Prepare thoroughly for your Android development journey!

An abstract class serves as a blueprint for other classes and allows for the definition of common behavior while leaving the implementation of certain functions or properties to the subclasses. This means that abstract classes can indeed declare abstract properties or functions without providing their implementations. Subclasses derived from the abstract class are then responsible for providing concrete implementations for these abstract members.

This ability to declare abstract properties and functions is a fundamental feature of abstract classes, aiding in the design of a flexible and extensible code architecture. It allows for defining a consistent interface that all subclasses must adhere to, while still enabling customization for specific needs in each subclass.

In contrast, an abstract class cannot be instantiated directly since doing so would not provide implementations for its abstract members, making option A incorrect. Moreover, option B is incorrect because abstract classes can have both abstract and concrete methods; they are not required to implement all their methods. Finally, option D is incorrect as well because abstract classes are designed to be extended by subclasses, allowing for inheritance and code reuse, which is a primary purpose of defining them.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy