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

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.

主站蜘蛛池模板: 汾阳市| 双辽市| 金乡县| 青铜峡市| 大英县| 离岛区| 公主岭市| 自贡市| 方正县| 永丰县| 呼和浩特市| 剑河县| 连平县| 祁连县| 临漳县| 游戏| 隆尧县| 洞头县| 大邑县| 乡城县| 永泰县| 青田县| 华容县| 安塞县| 张家川| 花垣县| 射洪县| 尚义县| 孟津县| 玉屏| 乡宁县| 甘孜县| 油尖旺区| 囊谦县| 西平县| 库车县| 沭阳县| 阿合奇县| 马鞍山市| 古浪县| 五峰|