18

Class Objects and Methods

LEARNING OBJECTIVES

At the end of this chapter, you will be able to understand and use

  • Java's classes and objects.
  • Constructors and their overloading.
  • Java's methods and their usage.
  • This operator.
  • Inner classes.
  • Finalize method and Garbage collector.
  • Static methods and classes.

18.1 Introduction

Java is a pure object-oriented language and hence all programming is enclosed in classes. Object-oriented programming involves writing programs that use classes. We create objects of different classes to solve the problem at hand and make objects communicate with each other through the member functions.

In this chapter, we will learn how to solve problems by using classes and objects. We will also cover topics such ...

Get Object-oriented Programming Using C++ and Java 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.