Java - AbstractionWhich of the following is true about abstract classes in Java?AAbstract classes cannot be instantiated directly.BAbstract classes must have only abstract methods.CAbstract classes are always final.DAbstract classes do not support constructors.Check Answer
Step-by-Step SolutionSolution:Step 1: Understand instantiation rules for abstract classesAbstract classes cannot create objects directly because they are incomplete by design.Step 2: Check other options for correctnessAbstract classes can have concrete methods and constructors, and they cannot be final because they are meant to be extended.Final Answer:Abstract classes cannot be instantiated directly. -> Option AQuick Check:Abstract class instantiation = Not allowed [OK]Quick Trick: Abstract classes cannot create objects directly [OK]Common Mistakes:Thinking abstract classes can be instantiatedBelieving abstract classes must have only abstract methodsAssuming abstract classes cannot have constructors
Master "Abstraction" in Java9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Java Quizzes Abstraction - Partial abstraction - Quiz 5medium Classes and Objects - Object lifecycle - Quiz 7medium Constructors - Constructor execution flow - Quiz 4medium Constructors - Constructor overloading - Quiz 13medium Constructors - Constructor execution flow - Quiz 7medium Constructors - Constructor overloading - Quiz 5medium Custom Exceptions - Throwing custom exceptions - Quiz 3easy Interfaces - Why interfaces are used - Quiz 3easy Object-Oriented Programming Concepts - Why object-oriented programming is used - Quiz 12easy Polymorphism - Why polymorphism is needed - Quiz 3easy