接口问题请教 接口中没有实现,同名就同名吧就是只要在A类中实现那个void Mesage()就行了,那样B和C中的接口方法都实现了吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 interface Binterface{ void Message(); void OtherMethod();}interface Cinterface{ void Message();void OtherMethod();}class A imlements Binterface,Cinterface { void A(); public main(String args[]) { Binterface(); Cinterface(); } }不知道这样对吗《-----仁者见仁,智者见智----》 interface Binterface{ void Message(); void OtherMethod();}interface Cinterface{ void Message(); void OtherMethod();}class A implements Binterface,Cinterface { public void Message(){} public void OtherMethod(){} } 既然是imlements 那么接口中的方法必须全部实现类中的方法必须要有自己的实现 实现一个void Mesage()就行了 roundside(世道轮回)这位先生已经说得很清楚了,中要加上public void Message(){}public void OtherMethod(){}加上{}就是已经实现了接口,只不过没执行的代码,也就是不做任何事情,如果你要它做事,就写上你想实现的动作代码就可以了, float问题 ーー关于Java类的使用问题 将"a.b.c.d"中的点符号转换成反斜杠 请教一个Java3D的问题 关于SQLserver的一个问题。 急、急、急,请问JBUILDER 如何连接服务器上的ACCESS数据库,请高手们指点!! 怎么没有转换到小写? 谁会写HelloWord呢? 为什么我的这个程序运行时会出错? 简单的jdk1.3配置问题,求救! 读取字符串的子串问题!!急!!!在线等 String类的简单问题
{
void Message();
void OtherMethod();
}interface Cinterface
{
void Message();
void OtherMethod();}class A imlements Binterface,Cinterface
{
void A();
public main(String args[])
{
Binterface();
Cinterface();
}
}不知道这样对吗《-----仁者见仁,智者见智----》
{
void Message();
void OtherMethod();
}interface Cinterface
{
void Message();
void OtherMethod();}class A implements Binterface,Cinterface
{
public void Message(){}
public void OtherMethod(){}
}
那么接口中的方法必须全部实现
类中的方法必须要有自己的实现
这位先生已经说得很清楚了,中要加上
public void Message(){}
public void OtherMethod(){}
加上{}就是已经实现了接口,只不过没执行的代码,也就是不做任何事情,
如果你要它做事,就写上你想实现的动作代码就可以了,