This chapter explains to readers the most important aspects of Java programming: Application Programming Interfaces (APIs), object factories, method overriding, hiding, and overloading. An explanation of the design advantage of aggregation (versus inheritance) follows, starting the discussion around software system design. The chapter concludes with an overview of Java data structures.
In this chapter, we will cover the following topics:
- What is an API?
- Interface and object factory as APIs
- Overriding, hiding, and overloading
- The this and super keywords
- Constructors and constructor overloading
- Final variable, final method, and final class
- Object association (aggregation)
- Exercise – Restricting a class instantiation to a single shared instance