avatar
一个土土的问题# Java - 爪哇娇娃
j*1
1
发信人: mitbbs (未名空间), 信区: Complain
标 题: Re: [投诉]Trustinjesus版主dignity滥用权力任意删贴
发信站: BBS 未名空间站 (Tue Jun 21 03:46:35 2011, 美东)
处理结果
若未违反版规,且并未涉及攻击,应允许其存在和正常讨论
avatar
j*s
2
请教各位,
What is the difference between "interface" and " abstract class"?
他们都可用来实现多态,但是不明白他们的区别,请大家指点,谢谢!
avatar
g*g
3
Basically interface is an abstract class without instance variable.

【在 j****s 的大作中提到】
: 请教各位,
: What is the difference between "interface" and " abstract class"?
: 他们都可用来实现多态,但是不明白他们的区别,请大家指点,谢谢!

avatar
c*t
4
You can implement multple interfaces but can only extend one abstract
class :D
Other than that, abstract class/interfaces are about the same. However,
if you can put things into an interface, you should do so since you can
implement more interfaces.

【在 j****s 的大作中提到】
: 请教各位,
: What is the difference between "interface" and " abstract class"?
: 他们都可用来实现多态,但是不明白他们的区别,请大家指点,谢谢!

avatar
j*s
5
精辟!!!
谢谢!!!

【在 c*****t 的大作中提到】
: You can implement multple interfaces but can only extend one abstract
: class :D
: Other than that, abstract class/interfaces are about the same. However,
: if you can put things into an interface, you should do so since you can
: implement more interfaces.

avatar
y*a
6
another thing is that you can implement some methods in abstract class; but
you can't do it in interface.

【在 c*****t 的大作中提到】
: You can implement multple interfaces but can only extend one abstract
: class :D
: Other than that, abstract class/interfaces are about the same. However,
: if you can put things into an interface, you should do so since you can
: implement more interfaces.

avatar
y*a
7
actually you can define instance variables in interface, but they are all
final.

【在 g*****g 的大作中提到】
: Basically interface is an abstract class without instance variable.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。