官术网_书友最值得收藏!

Objects in OOP

We now know what a class is. Now let's look at what object refers to in OOP.

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.

主站蜘蛛池模板: 达州市| 唐海县| 涞源县| 肇庆市| 清远市| 长岭县| 莫力| 长丰县| 松桃| 平塘县| 闸北区| 永年县| 平阴县| 商洛市| 凉城县| 永靖县| 蕲春县| 资源县| 孝义市| 洛阳市| 铜川市| 岱山县| 峨眉山市| 介休市| 杭锦后旗| 辽中县| 太湖县| 高平市| 休宁县| 包头市| 甘谷县| 宁南县| 克什克腾旗| 北安市| 滦南县| 泽普县| 瑞丽市| 南部县| 白朗县| 惠来县| 泗阳县|