aaarong
发贴: 24
积分: 0
|
于 2007-04-22 22:22
interface jiekou{ void f1(); }
class number1 implements jiekou{ double x1,y1; number1(double u1,double v1){ x1=u1;y1=v1; } public void f1(){ System.out.println(x1+"平方的值是"+x1*x1); System.out.println(y1+"平方的值是"+y1*y1); } }
class number2 implements jiekou{ double x2,y2; number2(double u1,double v2){ x2=u1;y2=v2; } public void f1(){ System.out.println(x2+"立方的值是"+x2*x2*x2); System.out.println(y2+"立方的值是"+y2*y2*y2); } } public class A_1_2_3_4{ public static void main(String []args){ double x,y,m,n; x=Double.parseDouble(args[0]); y=Double.parseDouble(args[1]); m=Double.parseDouble(args[2]); n=Double.parseDouble(args[3]); number1 pf1=new number1(x,y); number2 lf2=new number2(m,n); pf1.f1(); lf2.f1(); } } 去把书再多看看吧 学习=看书+思考+看书 温故而知新............ 本人的一套学习方法 希望对你能有所帮助
|