当前位置:网站首页>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
边栏推荐
- 蓝桥杯单片机省赛第九届
- [untitled] basic operation of raspberry pie (2)
- 知物由学 | 自监督学习助力内容风控效果提升
- Kotlin 基础学习13
- 初出茅庐市值1亿美金的监控产品Sentry体验与架构
- Merge interval, linked list, array
- MySQL advanced (Advanced) SQL statement (II)
- Discrimination between sap Hana, s/4hana and SAP BTP
- 《MATLAB 神经网络43个案例分析》:第41章 定制神经网络的实现——神经网络的个性化建模与仿真
- Docker安装canal、mysql进行简单测试与实现redis和mysql缓存一致性
猜你喜欢

MySQL advanced (Advanced) SQL statement (II)

MySQL connection query and subquery

《MATLAB 神经网络43个案例分析》:第42章 并行运算与神经网络——基于CPU/GPU的并行神经网络运算

Continuous assignment of Verilog procedure

Pointer array & array pointer

Verilog timing control

Knowing things by learning | self supervised learning helps improve the effect of content risk control

One of the future trends of SAP ui5: embrace typescript

蓝桥杯单片机省赛第十二届第二场
![[HCIA continuous update] working principle of OSPF Protocol](/img/bc/4eeb091c511fd563fb1e00c8c8881a.jpg)
[HCIA continuous update] working principle of OSPF Protocol
随机推荐
West digital decided to raise the price of flash memory products immediately after the factory was polluted by materials
【DesignMode】建造者模式(Builder model)
Intersection of Venn graph
C#联合halcon脱离halcon环境以及各种报错解决经历
spark调优
JIT deep analysis
Global and Chinese market of autotransfusion bags 2022-2028: Research Report on technology, participants, trends, market size and share
Spark Tuning
[yolo3d]: real time detection of end-to-end 3D point cloud input
In wechat applet, the externally introduced JS is used in xwml for judgment and calculation
[designmode] Prototype Pattern
焱融看 | 混合云时代下,如何制定多云策略
蓝桥杯单片机省赛第十一届
Which of PMP and software has the highest gold content?
MySQL connection query and subquery
在QML中加载不同字体
Verilog parallel block implementation
Introduction to Robotics II. Forward kinematics, MDH method
NLog use
/silicosis/geo/GSE184854_ scRNA-seq_ mouse_ lung_ ccr2/GSE184854_ RAW/GSM5598265_ matrix_ inflection_ demult