当前位置:网站首页>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>-1.基础结构

2021-04-23

基于南航app直减自动出票

【第一周】深度学习和pytorch基础

Delightful Nuxt3 Tutorial (2): Build a Blog Quickly and Easily

自监督论文阅读笔记 DenseCL:Dense Contrastive Learning for Self-Supervised Visual Pre-Training

002_旭日X3派初探:TogetherROS安装

采用Trench肖特基二极管,实现功率密度的显著提升

【第四周】MobileNet和HybridSN

2021-04-30
随机推荐
自监督论文阅读笔记 SimCLRV2 Big Self-Supervised Models are Strong Semi-Supervised Learners
PCB设计经验之模拟电路和数字电路区别为何那么大
Convolutional Nerual Nertwork(CNN)
ASP.NET MVC3的伪静态实现
A.1#【内存管理】——1.1.1 node:struct pglist_data
嵌入汇编-1 格式讲解
代码没写完,哪里有脸睡觉!17 张程序员壁纸推荐
VS2022 encapsulation under Windows dynamic library and dynamic library calls
ZEMAX | 如何创建复杂的非序列物体
Kotlin 中的泛型介绍
自监督论文阅读笔记 S3Net:Self-supervised Self-ensembling Network for Semi-supervised RGB-D Salient Object Det
虚拟地址空间布局
借助ginput函数在figure窗口实时读取、展示多条曲线的坐标值
滚动条 scrollbar 和scrollbar-thumb 样式
常见的电子元器件分类介绍-唯样商城
opencv目标检测
在大程序中怎么样显示LED点阵
神经网络之感知机
Hook初探索
浮点型数据在内存中存储的表示