摘要: 在java中,要是 出现接口中常量和方法冲突时。1.要是常量冲突,可以在实现接口里实用全限定名(接口名称.常量名称明确指定常量所属接口如果是方法冲突,只要实现一个方法就可以了。public class hh{ public static void main(String []args) { Circle circle=new Circle(7); float area=circle.getArea(); System.out.println("圆的面积:"+area); float girth=circle.getGirth(); System.out.println(&q 阅读全文
posted @ 2011-07-09 19:34 又是一年夏天 阅读(287) 评论(0) 推荐(0)
摘要: class Animal{ public static void textClassMethod() { System.out.println("Animal中的类方法"); } public void textinstanceMethod() { System.out.println("Animal中的实例方法"); }} class Cat extends Animal { public static void textClassMethod() { System.out.println("Cat中的类方法"); } public 阅读全文
posted @ 2011-07-09 16:11 又是一年夏天 阅读(623) 评论(0) 推荐(1)