Class ObjectOrientedBasicsExamples
java.lang.Object
net.jrodolfo.java_evolution.java01.ObjectOrientedBasicsExamples
Refreshes early Java object-oriented basics: classes, objects, inheritance,
overriding, and encapsulation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionUses polymorphism through a superclass reference.intUses encapsulated state exposed through behavior.
-
Constructor Details
-
ObjectOrientedBasicsExamples
public ObjectOrientedBasicsExamples()
-
-
Method Details
-
dispatchThroughSuperclass
Uses polymorphism through a superclass reference.- Returns:
- the subclass implementation selected at runtime
-
rectangleArea
public int rectangleArea()Uses encapsulated state exposed through behavior.- Returns:
- calculated area
-