zoukankan
html css js c++ java
抽象类和接口的区别
接口和抽象类的区别:
1.接口的所有方法都是抽象的,抽象类里面的方法可以是抽象的也可以不是抽象的;
2.接口和抽象类都不能实例化,接口需要类来实现后实例化实现类,抽象类需要类来继承然后实例化子类;
3.抽象类只能单继承,接口也可以单继承接口,接口也还可以多实现;
4.接口中的属性是static final类型的,抽象类中的属性跟普通类中的属性没有区别;
5.接口中的方法默认就是抽象的不需要加abstract,抽象类中的抽象方法需要加abstract关键字
查看全文
相关阅读:
Max Sum Plus Plus HDU
Monkey and Banana HDU
Ignatius and the Princess IV HDU
Extended Traffic LightOJ
Tram POJ
Common Subsequence HDU
最大连续子序列 HDU
Max Sum HDU
畅通工程再续
River Hopscotch POJ
原文地址:https://www.cnblogs.com/haoyuecanglang/p/9920790.html
最新文章
CCF CSP 201909-1 小明种苹果
Codeforces 118A
Codeforces 118A
Codeforces 158A
Codeforces 158A
Python Ethical Hacking
Python Ethical Hacking
Python Ethical Hacking
Python Ethical Hacking
Python Ethical Hacking
热门文章
Python Ethical Hacking
Python Ethical Hacking
Python Ethical Hacking
Python Ethical Hacking
Python Ethical Hacking
FatMouse's Speed HDU
Tickets HDU
免费馅饼 HDU
Piggy-Bank HDU
Doing Homework HDU
Copyright © 2011-2022 走看看