Java syntax: Difference between revisions

Content deleted Content added
m Inheritance: language cleanup
m Abstract classes: formatting
Line 1,188:
A class C has abstract methods if any of the following is true:
 
* C explicitly contains a declaration of an abstract method.
A* direct superinterfaceAny of C's declaressuperclasses orhas inheritsan aabstract method (which is therefore necessarily abstract) and C neither declares nor inherits a method that implements it.
 
Any* A direct superinterface of C's superclassesdeclares hasor aninherits abstracta method (which is therefore necessarily abstract) and C neither declares nor inherits a method that implements it.
* A subclass of an abstract class that is not itself abstract may be instantiated, resulting in the execution of a constructor for the abstract class and, therefore, the execution of the field initializers for instance variables of that class.
 
A direct superinterface of C declares or inherits a method (which is therefore necessarily abstract) and C neither declares nor inherits a method that implements it.
 
A subclass of an abstract class that is not itself abstract may be instantiated, resulting in the execution of a constructor for the abstract class and, therefore, the execution of the field initializers for instance variables of that class.
 
<source lang=Java5>