| layout | page |
|---|---|
| title | 401.06 Reading Notes |
| permalink | /401-R06/ |
-
In Java, subclasses of a class ("superclass" relative to the subclass) inherit state and behavior, such as having access to all methods defined for the parent class.
-
Each class may have only one superclass "above" it in inheritance, but has no limit to the number of subclasses "below".
-
Subclass delcaration syntax:
class SubclassName extends SuperclassName {/*subclass code block*/}
-
In Java, an interface is a specified list of object behaviors.
-
Interface syntax:
interface ClassName {void methodToImplementLater(int parameterName);} -
An implemented class must define each method declared in the interface.
-
Implementation syntax:
class ImplementedClassName implements ClassName{/*code block*/void methodToImplementLater (int parameterName) {/*method code block*/}
-
A Java package is a grouping of related or otherwise interacting classes and interfaces.
-
The Application Programming Interface package for Java contains very many commonly used classes (Documentation Here)