由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - 一个土土的问题
相关主题
interface可不可以有variable?can applet implements runnable?
报offer咯[转载] help please on Java
How does a client find and connect to a specificHelp! interface Scanner with Pdf file
What specific services does a container provide fJDBC or SQL-C?
Re: Can create a Interface object, why?simple question: What is API stand for?
Re: 问一个关于Java Native Interface的问题Why Java needs clone interface?
Re: question about interface.(也许是答案)help: interface and class
Re: Java Tip: Constant问一个特别土的问题
相关话题的讨论汇总
话题: interface话题: abstract话题: class话题: interfaces话题: implement
进入Java版参与讨论
1 (共1页)
j****s
发帖数: 34
1
请教各位,
What is the difference between "interface" and " abstract class"?
他们都可用来实现多态,但是不明白他们的区别,请大家指点,谢谢!
g*****g
发帖数: 34805
2
Basically interface is an abstract class without instance variable.

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

c*****t
发帖数: 1879
3
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"?
: 他们都可用来实现多态,但是不明白他们的区别,请大家指点,谢谢!

j****s
发帖数: 34
4
精辟!!!
谢谢!!!

【在 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.

y**a
发帖数: 13
5
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.

y**a
发帖数: 13
6
actually you can define instance variables in interface, but they are all
final.

【在 g*****g 的大作中提到】
: Basically interface is an abstract class without instance variable.
1 (共1页)
进入Java版参与讨论
相关主题
问一个特别土的问题Re: Can create a Interface object, why?
问题征解Re: 问一个关于Java Native Interface的问题
这个方法到底如何调用的?Re: question about interface.(也许是答案)
Java如何调用MATLAB?Re: Java Tip: Constant
interface可不可以有variable?can applet implements runnable?
报offer咯[转载] help please on Java
How does a client find and connect to a specificHelp! interface Scanner with Pdf file
What specific services does a container provide fJDBC or SQL-C?
相关话题的讨论汇总
话题: interface话题: abstract话题: class话题: interfaces话题: implement