下面给出了一个矩形类Rectangle,其中含有多个构造方法。 classRectangle //矩形类 { int width; //矩形的宽度 int length; //矩形的长度 public Rectangle() { length=30;width=20; } public Rectangle(intl,intw) { length=l;width=w; } } public class CRctngle { public static void main(String args[]) { Rectanglex1=newRectangle(); Rectanglex2=newRectangle(50,40); System.out.println(x1.length()); //[代码1] System.out.println(x1.width()); //[代码2] System.out.println(x2.length()); //[代码3] System.out.println(x2.width()); ////[代码4] } }