当前位置:网站首页>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
边栏推荐
- Detailed explanation of ThreadLocal
- 蓝桥杯单片机省赛第六届
- What kind of interview is more effective?
- Kotlin basic learning 15
- Oracle 常用SQL
- [untitled] basic operation of raspberry pie (2)
- < job search> process and signal
- Grpc quick practice
- Global and Chinese market of handheld ultrasonic scanners 2022-2028: Research Report on technology, participants, trends, market size and share
- 蓝桥杯单片机省赛第十一届
猜你喜欢
In the era of programmers' introspection, five-year-old programmers are afraid to go out for interviews
[yolo3d]: real time detection of end-to-end 3D point cloud input
West digital decided to raise the price of flash memory products immediately after the factory was polluted by materials
Introduction to Robotics II. Forward kinematics, MDH method
初出茅庐市值1亿美金的监控产品Sentry体验与架构
Learn PWN from CTF wiki - ret2shellcode
How to do medium and long-term stocks, and what are the medium and long-term stock trading skills?
《MATLAB 神经网络43个案例分析》:第42章 并行运算与神经网络——基于CPU/GPU的并行神经网络运算
Getting started with MQ
【DesignMode】原型模式(prototype pattern)
随机推荐
蓝桥杯单片机省赛第十一届
在QML中加载不同字体
蓝桥杯单片机第四届省赛
Pointer array & array pointer
Global and Chinese market of gynaecological health training manikin 2022-2028: Research Report on technology, participants, trends, market size and share
PY3 link MySQL
Apple added the first iPad with lightning interface to the list of retro products
[mv-3d] - multi view 3D target detection network
Oracle 常用SQL
[C Advanced] brother Peng takes you to play with strings and memory functions
Yan Rong looks at how to formulate a multi cloud strategy in the era of hybrid cloud
MySQL index, transaction and storage engine
Go execute shell command
Which of PMP and software has the highest gold content?
Download and use of the super perfect screenshot tool snipaste
Global and Chinese markets for welding equipment and consumables 2022-2028: Research Report on technology, participants, trends, market size and share
蓝桥杯单片机省赛第十届
SAML2.0 notes (I)
PY3, PIP appears when installing the library, warning: ignoring invalid distribution -ip
UI (New ui:: MainWindow) troubleshooting