当前位置:网站首页>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

边栏推荐
- Read AFN through - from the creation of manager to the completion of data parsing
- Go language - what is critical resource security?
- Tensorflow loading cifar10 dataset
- In the wechat environment, H5 jumps to the specified page of the applet
- Record learning of hystrix knowledge --20210929
- Load local cifar10 dataset
- Problems caused by using ApplicationContext to render layout
- What is backbone network
- 报错:homebrew-core is a shallow clone
- Collection overview, array encapsulation
猜你喜欢

Prototype chain analysis

深入理解和把握数字经济的基本特征

Principle analysis of ThreadLocal source code

一行代码可以做什么?
Introduction to database transactions

error Parsing error: Unexpected reserved word ‘await‘.
Practice of geospatial data in Nepal graph

Educational administration system development (php+mysql)

Vscode有什么好用的插件?

Go language - what is critical resource security?
随机推荐
Catheon gaming appointed mark Aubrey, former Asia Pacific head of Activision Blizzard, as CEO
Problems caused by using ApplicationContext to render layout
When inputting text in the shutter textfield, if the page is refreshed, the cursor position will change.
Uniapp converts graphic verification codes in the form of file streams into images
Multiple decorators decorate a function
Unity技术手册 - 干扰/噪音/杂波(Noise)子模块
Reverse series to obtain any wechat applet code
Deadlock, thread communication, singleton mode
深入理解和把握数字经济的基本特征
Bombard the headquarters. Don't let a UI framework destroy you
Common APIs and exception mechanisms
What is the NFT digital collection?
不要小看了积分商城,它的作用可以很大!
商城风格也可以很多变,DIY了解一下!
Catheon Gaming任命Activision Blizzard前亚太区负责人Mark Aubrey担任首席执行官
Interviewer: your resume says you are proficient in mysql, so you say cluster / Union / overlay index, table return, index push down
一文带你搞懂 JWT 常见概念 & 优缺点
[problem solving] dialogfragment can not be attached to a container view
User login 2
Blue Bridge Cup - practice system login