当前位置:网站首页>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.
边栏推荐
- 采用Trench肖特基二极管,实现功率密度的显著提升
- 自监督论文阅读笔记Index Your Position: A Novel Self-Supervised Learning Method for Remote Sensing Images Sema
- 中空编码器的作用——唯样商城
- What is parametric design, let's understand it through practical operation?| SOLIDWORKS How-To Videos
- 自监督论文阅读笔记Efficient Self-supervised Vision Pretraining with Local Masked Reconstruction
- Makefile
- pandoc -crossref插件实现markdwon文档转word后公式编号自定义
- opencv透视变化
- ZEMAX | 绘图分辨率结果对光线追迹的影响
- ZEMAX | 如何使用渐晕系数
猜你喜欢
001_旭日X3派初探:开箱测试
JS--正则表达式
ZEMAX | 如何使用ZOS-API创建自定义操作数
Convolutional Nerual Nertwork(CNN)
关于梯度下降法的一些优化方法
Practice of MySql's Sql statement (try how many you can write)
使用JSP实现简单的登录注册功能,并且使用Session跟踪用户登录信息
自监督论文阅读笔记Index Your Position: A Novel Self-Supervised Learning Method for Remote Sensing Images Sema
自监督论文阅读笔记Reading and Writing: Discriminative and Generative Modelingfor Self-Supervised Text Recogn
MATLAB给多组条形图添加误差棒
随机推荐
中空编码器的作用——唯样商城
IO 复用
设备树(devicetree)-dts语法
自监督论文阅读笔记FIAD net: a Fast SAR ship detection network based on feature integration attention and self
【第四周】MobileNet和HybridSN
memblock
建立平衡二叉树简单demo
5. What is the difference between int and Integer?
servlet学习(七)ServletContext
虚拟地址空间布局
C# 数组之回溯法
Typora
ZEMAX | 在OpticStudio中建立扩增实境(VR)头戴式显示器
ZEMAX | 探究 OpticStudio 偏振分析功能
自监督论文阅读笔记 Incremental-DETR:Incremental Few-Shot Object Detection via Self-Supervised Learning
自监督论文阅读笔记 Self-supervised Label Augmentation via Input Transformations
2021-03-22
A.1#【内存管理】——1.1.2 zone: struct zone
Convolutional Nerual Nertwork(CNN)
交叉熵(第六周)