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

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.

主站蜘蛛池模板: 射洪县| 寻乌县| 浦江县| 灯塔市| 大荔县| 宽甸| 仪陇县| 德格县| 定结县| 兰州市| 紫阳县| 改则县| 班戈县| 盐源县| 新安县| 抚州市| 合山市| 罗山县| 康保县| 吐鲁番市| 独山县| 桂平市| 黄冈市| 泗阳县| 南开区| 隆子县| 孝义市| 奎屯市| 水富县| 青阳县| 阿勒泰市| 隆回县| 大丰市| 咸丰县| 拜泉县| 渭南市| 建平县| 吉木萨尔县| 盘锦市| 长沙县| 灯塔市|