当前位置:网站首页>Day_ thirteen
Day_ thirteen
2022-06-25 16:25:00 【grp_ grp_ grp】
1. The relationship between classes
Inherit :
key word : extends
Class and class are single inheritance , Interface and interface are multi inheritance ,


Realization :
key word : implement
There are multiple implementations between classes and interfaces , Multiple are separated by commas Class Class name implements Interface , Interface ....{}
Class implements the interface , All abstract methods must be implemented , Otherwise, it is necessary to add abstract modification

rely on :

relation :

polymerization :
Both the whole and the part have independent life cycles
Combine :
Part and whole are inseparable , For example, the human body is a combination
2. Inner class
Definition :
When the inside of a thing , There is another part that needs a complete structure to describe , And this inside The complete structure of the ministry only provides services for external things , Then the whole internal structure is better to make Use inner classes
stay Java in , Allow the definition of one class to be inside another class , The former is called the inner class , The latter is called the outer class .
Inner class It is generally used within the class or statement block that defines it , It must be given the full name when it is externally referenced .
Member inner class :

Static inner class :

Local inner classes :

Anonymous inner class :

3. Design patterns

Starving model :
The load phase creates objects
The sluggard model :
Create objects when you use them

边栏推荐
- GO语言-什么是临界资源安全问题?
- Uncover gaussdb (for redis): comprehensive comparison of CODIS
- When inputting text in the shutter textfield, if the page is refreshed, the cursor position will change.
- Mysql database multi table query
- Go language - what is critical resource security?
- Servlet details
- Multiple decorators decorate a function
- 心樓:華為運動健康的七年築造之旅
- Unity技术手册 - 生命周期旋转RotationOverLifetime-速度旋转RotationBySpeed-外力ExternalForces
- Coredata data persistence
猜你喜欢

GO语言-什么是临界资源安全问题?
Consumer and producer cases of inter thread synchronization (condition variable)
Practice of geospatial data in Nepal graph

Xinlou: Huawei's seven-year building journey of sports health

20省市公布元宇宙路线图

Unity技术手册 - 生命周期旋转RotationOverLifetime-速度旋转RotationBySpeed-外力ExternalForces

一行代码可以做什么?
Why does golang's modification of slice data affect the data of other slices?

DOM event flow, event delegate

炮打司令部,别让一个UI框架把你毁了
随机推荐
This article will help you understand the common concepts, advantages and disadvantages of JWT
MySQL installation tutorial
cmd。。。。。。
Summary of 2022 spring moves of ordinary people (Alibaba and Tencent offer)
Sleep formula: how to cure bad sleep?
Why does golang's modification of slice data affect the data of other slices?
Learning notes of rxjs takeuntil operator
Understand the execution sequence of try catch finally in one diagram
Dino: Detr with improved detecting anchor boxes for end to end object detection
普通人的2022春招总结(阿里、腾讯offer)
What can one line of code do?
Overall MySQL architecture and statement execution process
Flutter textfield setting can input multiple lines
[Third Party framework] retrofit2 (2) - add point configuration of network access framework
JS add custom attributes to elements
Once the code was encrypted by the company's computer, the compilation failed
The style of the mall can also change a lot. DIY can learn about it!
Based on neural tag search, the multilingual abstracts of zero samples of Chinese Academy of Sciences and Microsoft Asiatic research were selected into ACL 2022
Bombard the headquarters. Don't let a UI framework destroy you
心楼:华为运动健康的七年筑造之旅