Objects and Classes
Object-oriented programming (OOP) works by modeling applications on real-world objects. The benefits of OOP, as discussed in Introduction, are real, which explains why OOP is the paradigm of choice today and why OOP languages like Java are popular. This chapter introduces you to objects and classes. If you are new to OOP, you may want to read this chapter carefully. A good understanding of OOP is the key to writing quality programs.
This chapter starts by explaining what an object is and what constitutes a class. It then teaches you how to create objects in Java using the new keyword, how objects are stored in memory, how classes can be organized into packages, how to use access control to achieve encapsulation, ...