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

边栏推荐
- Mysql database multi table query
- Hash table, generic
- Collection overview, array encapsulation
- 20省市公布元宇宙路线图
- Converting cifar10 datasets
- iVX低代码平台系列详解 -- 概述篇(一)
- The paid video at station B caused the up master to lose more than ten thousand fans
- Day21 multithreading
- Check whether the port number is occupied
- Deadlock, thread communication, singleton mode
猜你喜欢

error Parsing error: Unexpected reserved word ‘await‘.

Don't underestimate the integral mall, its role can be great!

10款超牛Vim插件,爱不释手了

Preliminary understanding of JVM

Understand the execution sequence of try catch finally in one diagram

AutoK3s v0.5.0 发布 延续简约和友好

The first day of reading mysql45
Check whether the port number is occupied

Swift responsive programming

10 Super VIM plug-ins, I can't put them down
随机推荐
Reverse series to obtain any wechat applet code
Prototype chain analysis
Tensorflow loading cifar10 dataset
This article will help you understand the common concepts, advantages and disadvantages of JWT
Inter thread synchronization semaphore control
Read AFN through - from the creation of manager to the completion of data parsing
User registration, information writing to file
赫尔辛基交通安全改善项目部署Velodyne Lidar智能基础设施解决方案
心楼:华为运动健康的七年筑造之旅
First knowledge of database
Consumer and producer cases of inter thread synchronization (condition variable)
Understand the execution sequence of try catch finally in one diagram
Flutter assembly
Time wheel and implementation analysis of time wheel in go zero
Record learning of hystrix knowledge --20210929
Go language - lock operation
Android修行手册之Kotlin - 自定义View的几种写法
Unity技术手册 - 生命周期内大小(Size over Lifetime)和速度决定大小(Size by Speed)
Introduction to database transactions
cmd。。。。。。