Objects in Object-oriented programming

We now know what a class is. Now let's look at what object refers to in the phrase object-oriented programming.

An object is an instance of a class. In other words, an object is an implementation of a class. For example, in our banking application, we have a Customer class, but that doesn't mean that we actually have a customer in our application. To create a customer, we have to create an object of the Customer class. Let's say that we have a customer called Mr. Jack Jones. For this customer, we have to create an object of the Customer class where the name of the person is Jack Jones.

As Mr. Jones is our customer, this means that he also has an account in our bank. To create a bank account for Mr. Jones, we have to create an object of the BankAccount class.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.47.169