当前位置:网站首页>Interface and abstract class
Interface and abstract class
2022-07-22 07:02:00 【It could be something else】
From the perspective of design
Abstract classes provide one IS-A Relationship , Then you have to satisfy the inside substitution principle , That is, the subclass object must be able to replace all the superclass objects . An interface is more like a LIKE-A Relationship , It just provides a way to implement the contract , Interfaces and classes that implement them are not required to have IS-A Relationship .
In terms of usage
A class can implement multiple interfaces , But cannot inherit multiple abstract classes .
The fields of the interface can only be static and final Type of , The fields of the abstract class have no such restriction .
The members of the interface can only be public Of , Members of abstract classes can have multiple access rights .
边栏推荐
- Airtest踩过的坑--启动闪退
- 请问开户对年龄有限制么?请问,手机开户股票开户安全吗?
- Foundation of Mathematics: NPC problems
- 【数学基础】 foundation of mathematics :拉格朗日优化和对偶
- VI editor common commands
- String... 可变长度参数列表
- JMeter Association (II)
- [MySQL and database] MySQL & database Chapter 10: function learning
- OS实验五 基于内核栈切换的进程切换
- Codeforces Round #690 (Div. 3) B. Last Year‘s Substring 常规解法
猜你喜欢
随机推荐
After uniapp sets tabbar jump, other pages jump to the home page (sorting)
QT—图形视图
IO模型、多路复用
2022.7.19 模拟赛
地理卫星数据下载
缓存穿透、雪崩、一致性问题
VI editor common commands
logisim计组实验十 单周期MIPS CPU
c语言 - 如何使用结构体和结构体指针?
三星Galaxy Fold拆解:内部极其复杂,铰链成屏幕损坏主因?
【数学基础】 foundation of mathematics :Jensen不等式
东方广益深夜辟谣,称入股锤子被立案调查消息不实!
笔记本电脑选购指南(不推荐具体品牌及型号)
【MATLAB问题解决】解决Matlab编译后的.exe文件在另一台电脑上无法运行的问题
Jmeter安装与设置(一)
Microsoft Visio Professional 2013打不开也卸载不了解决办法
js实现一个Promises/A+ 规范的Promise
Is online stock account opening complicated? Excuse me, is it safe to open a stock account by mobile phone?
PS抠出logo
【MySQL和数据库】MySQL & database 第八章:MySQL中的变量