image

CHAPTER

3

Classes

imagehe main motive behind using object-oriented programming is the code reuse. Java is an object-oriented programming language and therefore allows you to reuse your code. A typical Java application contains many objects. An object is an instance of a class. A program may contain many classes. In this chapter, you learn what a class is, what an instance of a class is, and how to use classes in your Java programs. We have looked at several Java programs in earlier chapters; however, all these programs used only one class. Therefore, ...

Get Java Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.