O'Reilly logo

Object-oriented Programming Using C++ and Java by Anand Vasappanavara, Gautam Vasappanavara, Ramesh Vasappanavara

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required