当前位置:网站首页>Object oriented thinking
Object oriented thinking
2022-07-02 03:34:00 【MangataTS】
# Summary of knowledge points Chapter II
1. object : Representing something " complex " Data is called objects , That is, some basic data types / The new composite data type formed by putting the composite data type into a class becomes an object
2. Object oriented languages have many advantages , Such as code reuse 、 extensible 、 Easy to maintain, etc
3. Three characteristics of object-oriented language : encapsulation 、 inheritance 、 polymorphism
encapsulation : Encapsulation immediately realizes the hiding of data , Some data is hidden from other parts of the program , Prevent others from modifying important data
inheritance : To support code reusability 、 Reduce the total amount of code in the program
polymorphism :Java There are two kinds of polymorphism: Method rewriting and method overloading
4.static The modified variable is a class variable
5. stay Java You can use private To modify a class ( It is usually used in one class Inside , Ensure data security )
6.System Classes of cannot be instantiated , That is, you cannot create System The object of , Usually we can go directly through System. visit System Method or property of
7. Every class must have a constructor , If you don't write it yourself , The system will generate a constructor by default , So a class must have a constructor , And the constructor has no return value
8. class 、 attribute 、 Methods can be modified by more than one modifier such as private static……
9. A static method of a class ( Yes static modification ) Can't access non static member variables , But an instance method ( nothing static modification ) You can access any member variable
10. Static variables are shared by all instance objects of the same class
11. Instance variables can only be accessed through objects , But class variables ( Static variables ) It can be accessed through classes or objects
12. The instance method of class represents The behavior of class objects
边栏推荐
- 焱融看 | 混合雲時代下,如何制定多雲策略
- Form custom verification rules
- Global and Chinese markets for ultrasonic probe disinfection systems 2022-2028: Research Report on technology, participants, trends, market size and share
- FFMpeg AVFrame 的概念.
- 初出茅庐市值1亿美金的监控产品Sentry体验与架构
- Kotlin基础学习 14
- C#聯合halcon脫離halcon環境以及各種報錯解决經曆
- Kotlin basic learning 13
- Kotlin基础学习 17
- [database]jdbc
猜你喜欢
[HCIA continuous update] working principle of OSPF Protocol
傅里叶级数
halcon图像矫正
初出茅庐市值1亿美金的监控产品Sentry体验与架构
Getting started with MQ
Which of PMP and software has the highest gold content?
蓝桥杯单片机第四届省赛
焱融看 | 混合云时代下,如何制定多云策略
High performance and low power cortex-a53 core board | i.mx8m Mini
Gradle foundation | customize the plug-in and upload it to jitpack
随机推荐
[designmode] builder model
跟着CTF-wiki学pwn——ret2shellcode
Review materials of project management PMP high frequency examination sites (8-1)
蓝桥杯单片机省赛第十二届第一场
Large screen visualization from bronze to the advanced king, you only need a "component reuse"!
Xlwings drawing
Merge interval, linked list, array
Download and use of the super perfect screenshot tool snipaste
Haute performance et faible puissance Cortex - A53 Core Board | i.mx8m mini
在QML中加载不同字体
Use blocking or non blocking for streamline
PY3, PIP appears when installing the library, warning: ignoring invalid distribution -ip
Discrimination between sap Hana, s/4hana and SAP BTP
Detailed explanation of the difference between Verilog process assignment
Verilog parallel block implementation
This article describes the step-by-step process of starting the NFT platform project
How to do medium and long-term stocks, and what are the medium and long-term stock trading skills?
微信小程序中 在xwml 中使用外部引入的 js进行判断计算
What is the logical structure of database file
NLog使用