当前位置:网站首页>The difference between abstract classes and interfaces
The difference between abstract classes and interfaces
2022-07-06 13:39:00 【Wake up duck, did you program today?】
First, let's look at abstract classes , What is an abstract class ?
1、 Abstract classes don't necessarily have abstract methods , Abstract classes must have keywords abstract To modify
2、 If a class contains abstract methods , So this class must be an abstract class
3、 Abstract classes cannot be used final Embellishment stands for , Because abstract classes are used for inheritance , however final Modified representative cannot be modified , Non inheritable
The difference between interface and abstract class ?
1、 A subclass can only inherit one abstract class , But you can implement multiple interfaces
2、 Abstract classes have construction methods , Interface has no constructor
3、 Abstract classes can have common member variables , There cannot be
4、 Abstract classes and interfaces can have static member variables , But member variables in abstract classes can be of any type , The interface can only be public static final( Default )
5、 There doesn't have to be an abstract method in an abstract class , But the methods in the interface must be abstract
6、 Abstract classes can have static methods , There cannot be static methods in an interface
7、 The methods in an abstract class can be public、protected, Methods in an interface can only be public
边栏推荐
- This time, thoroughly understand the MySQL index
- MySQL lock summary (comprehensive and concise + graphic explanation)
- 3. Number guessing game
- 透彻理解LRU算法——详解力扣146题及Redis中LRU缓存淘汰
- 一段用蜂鸣器编的音乐(成都)
- Redis cache obsolescence strategy
- View UI Plus 发布 1.3.1 版本,增强 TypeScript 使用体验
- View UI plus released version 1.3.0, adding space and $imagepreview components
- View UI Plus 发布 1.2.0 版本,新增 Image、Skeleton、Typography组件
- arduino+水位传感器+led显示+蜂鸣器报警
猜你喜欢

2.初识C语言(2)

2.C语言矩阵乘法

Arduino+ds18b20 temperature sensor (buzzer alarm) +lcd1602 display (IIC drive)

7. Relationship between array, pointer and array

There is always one of the eight computer operations that you can't learn programming

Questions and answers of "signal and system" in the first semester of the 22nd academic year of Xi'an University of Electronic Science and technology

2. C language matrix multiplication
![[hand tearing code] single case mode and producer / consumer mode](/img/b3/243843baaf0d16edeab09142b4ac09.png)
[hand tearing code] single case mode and producer / consumer mode

View UI Plus 发布 1.2.0 版本,新增 Image、Skeleton、Typography组件

8. C language - bit operator and displacement operator
随机推荐
(超详细onenet TCP协议接入)arduino+esp8266-01s接入物联网平台,上传实时采集数据/TCP透传(以及lua脚本如何获取和编写)
[hand tearing code] single case mode and producer / consumer mode
1.C语言初阶练习题(1)
【九阳神功】2020复旦大学应用统计真题+解析
View UI Plus 发布 1.1.0 版本,支持 SSR、支持 Nuxt、增加 TS 声明文件
2. Preliminary exercises of C language (2)
[the Nine Yang Manual] 2022 Fudan University Applied Statistics real problem + analysis
C语言入门指南
5. Function recursion exercise
7.数组、指针和数组的关系
8. C language - bit operator and displacement operator
Voir ui plus version 1.3.1 pour améliorer l'expérience Typescript
[中国近代史] 第六章测验
5. Download and use of MSDN
arduino+水位传感器+led显示+蜂鸣器报警
杂谈0516
JS interview questions (I)
为什么要使用Redis
稻 城 亚 丁
1.C语言矩阵加减法