JavaAbstract
JavaAbstract
A class can be abstract even without abstract methods (for example, to prevent
instantiation).
Abstract methods must be implemented in the subclass unless the subclass is also
abstract
Can a subclass access static methods from the abstract class? Yes, via the class name,
not an object
If an abstract class has a static block, that block executes when the class is first
loaded.
Even though the abstract class cannot be instantiated, its static blocks still execute
if:
o You access any static method or static variable of the abstract class.
o Or when a concrete subclass is created (and it indirectly loads the abstract
class).
constructors in an abstract class are Package-private if you don't explicitly specify
an access modifier.