摘要:
// 图形类Shape package d922B; public class Shape { double getArea(ShapePara x){ return x.getArea(); } double getArea(Rect y) { return y.getA() y.getB(); 阅读全文
摘要:
//接口 ShapePara package d922B; public interface ShapePara { int getArea(); int getCircumference(); } //圆类 package d922B; public class Circle implements 阅读全文
摘要:
//Monkey类 package d922; public class Monkey { Monkey() { } Monkey (String s) { System.out.println(s); } public void speak() { System.out.println("咿呀") 阅读全文
摘要:
//People类 package d922; public class People { protected double height,weight; public void speakHello() { System.out.println("雷好"); } public double get 阅读全文
摘要:
//Instrument类 package d922; public class Instrument { public void play() { System.out.println("弹奏乐器"); } } //Wind类 package d922; public class Wind ext 阅读全文
摘要:
///Animal类 package d922A; public class Animal { private String kind; public String getKind() { System.out.println(kind); return kind; } public void se 阅读全文
摘要:
//矩形父类 package d922A; public class Rect { private double l,w; Rect(double c,double k) { l=c; w=k; } public double s() { return w l; } } ///立方体类 packag 阅读全文
摘要:
//Vehicle类 package d922A; public class Vehicle { private int wheels; private double weight; Vehicle() { weight=1;wheels=4; } Vehicle(int lun, double z 阅读全文
摘要:
//Shape类 package d922A; public class Shape { private double l,s; public double getL() { return l; } public void setL(double l) { this.l = l; } public 阅读全文