在接口类的实现中可否不只实现接口规定的方法? Could you give more details? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个当然可以,如下有三个类:testInterface.java是接口package test;public interface testInterface { public void _print(String s);}testImp.java是实现类package test;public class testImp implements testInterface{ public void _print(String s) { System.out.println(s); } public void _println() { System.out.println("other method"); }}testMian.java是执行类package test;public class testMian{ public static void main(String []args) { testImp t = new testImp(); t._print("test"); t._println(); }}如果想详细了解interface请到www.bruceeckel.com拜读thinking in java如果想继续交流[email protected] 不就是implements吗?为什么不能? 各位JAVA朋友,本人在学JAVA,遇到问题不少,这道JAVA 聊天程序出了问题,还请大家帮解答 一个Client-Server程序。怎么把这个改成窗口模式呀? DOM XML读取一问 请问这个小模块的STRUCTS框架应该怎样子设计? 一个简单的Java画图程序,为何不能正常显示? 50分求奇怪问题,为什么jframe里面不显示东西?在线等 界面的问题! 请问从哪里能下到java的详细的帮助~ client/server編程中的問題 哪里有更加人气的java 论坛?提供一下? 怎样生成日志文件 如何配置autoexec可以在命令行中用c:\>java hellow.class
package test;public interface testInterface {
public void _print(String s);
}testImp.java是实现类package test;public class testImp implements testInterface
{
public void _print(String s)
{
System.out.println(s);
} public void _println()
{
System.out.println("other method");
}
}testMian.java是执行类
package test;public class testMian
{
public static void main(String []args)
{
testImp t = new testImp();
t._print("test");
t._println();
}
}如果想详细了解interface请到www.bruceeckel.com拜读thinking in java如果想继续交流[email protected]