ocuments and Settings\administrator.XUELI.000\桌面\源程序(终稿)\第2章\C210\SortFromBigToSmall.java"
源代码在线查看: test.java
class Tree{
int height=0;
String name=new String("null");
Tree(int h){
height=h;
System.out.println("带整形参数的构造函数");
}
Tree(String n,int h){
this(h);
this.name=n;
System.out.println("带整形和字符串型参数的构造函数");
}
Tree(){
this("香蕉树",47);
System.out.println("默认的构造函数");
}
void showme(){
System.out.println("产生的树名为:"+name+",树高为:"+height);
}
}
public class Test{
public static void main(String[] args) {
Tree mytree=new Tree();
mytree.showme();
}
}