当前位置:网站首页>What is the difference between abstract classes and interfaces?
What is the difference between abstract classes and interfaces?
2022-07-23 11:57:00 【shuo277】
In terms of design , Abstraction is the abstraction of a class , Is a template design , Interface is the abstraction of behavior , It's a code of conduct .
Java Provides and supports the creation of abstract classes and interfaces . They have something in common , The difference is : All methods in the interface are implicit and abstract , Abstract classes can contain both abstract and non abstract methods .
Classes can implement many interfaces , But you can only inherit from one abstract class . Class does not implement all methods declared by abstract classes and interfaces , Of course , under these circumstances , Class must also be declared abstract .
Abstract classes can implement an interface without providing an interface method implementation .
Java The variables declared in the interface are all
finalOf . Abstract classes can contain nonfinalThe variable of .Java The member functions in the interface are... By default
publicOf . The permission modifier of an abstract class member function can beprivate,protectedOr is itpublic.The interface is absolutely Abstract , Cannot be instantiated . Abstract classes cannot be instantiated either , however , If it contains
#main(String[] args)Method can be called .
边栏推荐
- 1. Initial experience of MySQL
- MySQL存储引擎
- 规范数据库设计
- 数仓4.0笔记——用户行为数据采集二
- NFT digital collection development /dapp development
- Development of digital collection system: Baidu AI pays tribute to Air China
- [untitled]
- MySQL tree structure recursive query
- Installation and process creation of activiti app used by activiti workflow
- Yarn capacity scheduler settings
猜你喜欢
随机推荐
DBA command
Data warehouse 4.0 notes - data warehouse environment construction - Yan configuration
NFT digital collection development: Jingdong "Qida bear takes you to the capital" tourism package
Project instances used by activiti workflow
Charles抓包的使用步骤
ChaosLibrary·UE4开坑笔记
The user logs in continuously (interruption is allowed) to query SQL
八、集合框架和泛型
2. MySQL data management - DML (add, modify, delete data)
What is the IP address
Object类
Wordcount of the first Flink program
MySQL卸载
对.h5文件的迭代显示,h5py数据操作
互联网通信
Window runs gradle build ----- stacktrace. Exception occurs when the file framework-4.3.0.build-snapshot-schema.zip is not found
1. Know the database
静态链表
数仓4.0笔记---用户行为数据生成
2、MySQL数据管理--DML(添加、修改、删除数据)









