当前位置:网站首页>Eight, the difference between the interface of the abstract class
Eight, the difference between the interface of the abstract class
2022-08-03 06:10:00 【Shiyu】
One, the basic difference
1. Abstract classes allow the implementation of concrete idiom methods, while interfaces must have abstract methods and cannot have implementations.
2. A class can only inherit one abstract class, but it can implement multiple interfaces.
3. Abstract classes allow various types of member variables, while interface member variables are public static final.
4. Static code blocks and static methods are allowed in abstract classes, but interfaces do not.
5. The methods of abstract classes can be modified with public, protect, default, and private, while methods in interfaces only allow public.
Note:
jdk1.8 new features - interface
An interface can have static methods and default methods, which means that there are implemented methods in the interface.
边栏推荐
猜你喜欢
随机推荐
设备树(devicetree)-dts语法
什么是参数化设计,通过实操了解一下? | SOLIDWORKS 操作视频
自监督论文阅读笔记Efficient Self-supervised Vision Pretraining with Local Masked Reconstruction
最优化方法概述
深度学习理论课程第四、五章总结
Mysql 存储过程详解(procedure)
MCU接收串口字符型数据转换成数据型数据
自监督论文阅读笔记 TASK-RELATED SELF-SUPERVISED LEARNING FOR REMOTE SENSING IMAGE CHANGE DETECTION
交叉熵(第六周)
ZEMAX | 探索 OpticStudio中的序列模式
opencv目标检测
6. What is the difference between Vector, ArrayList and LinkedList?(design, performance, safety)
ASP.NET MVC:自定义 Route
芯片解密工作应该具备哪些条件?唯样商城
【第四周】MobileNet和HybridSN
new / malloc / delete / free之间的区别
MATLAB给多组条形图添加误差棒
自监督论文阅读笔记 Self-supervised Label Augmentation via Input Transformations
布尔盲注需简化代码
C# 数组之回溯法