以下程序,编译都能通过,但我就是找不到包啊,我存在D:盘中的,产生的包应在D:中吧。可没有啊。为什么??/ package shape123456789; interface show {double PI=3.141592; void setcircle(int a,int b); double area(); } class circle{ double r,x,y; public circle(double x,double y,double r) {this.x=x;this.y=y;this.r=r; System.out.println("圆心在:"+x+","+y);} public double area() {return 3.14159*r*r;} }
class zk extends circle implements show {int a,b; double x,y,r; zk(double x,double y,double r) {super(x,y,r);} public void setcircle(int a,int b)//一定要加public ,应为接口中的它被默认为public,否则通不过 {this.a=a;this.b=b;System.out.println("a="+a+" b="+b);} public double area() //一定要加public ,应为接口中的它被默认为public,否则通不过。 {return 2*super.area();} } public class zz { public static void main(String args[]) {zk c=new zk(10,10,2); c.setcircle(50,50); System.out.println("total:"+c.area()); } }