Summary
This chapter introduced you to the concepts of OOP and how they are implemented in Java. It provided an explanation of each concept and demonstrated how to use it in specific code examples. The Java language constructs of class
and interface
were discussed in detail. You also learned what overloading, overriding, and hiding are and how to use the final
keyword to protect methods from being overridden.
In the Polymorphism in action section, you learned about the powerful Java feature of polymorphism. This section brought all the presented material together and showed how polymorphism stays at the center of OOP.
In the next chapter, you will become familiar with the Java language syntax, including packages, importing, access modifiers, reserved and restricted keywords, and some aspects of Java reference types. You will also learn how to use the this
and super
keywords, what widening and narrowing conversions of primitive types are, boxing and unboxing, primitive and reference...