关于方法过载???
小弟刚学java对方法过载的概念老是不大清楚,下面有一段程序,能告诉我方法过载体现在什么地方吗
class Tree{
int height;
Tree(){
prt("Planting a seeding");
height=0;
}
Tree(int i){
prt("Creating new Tree that is");
height=i;
}
void info(){
prt("Tree is "+height+" feel tall");
}
void info(String s){
prt(s+":Tree is"+height+" feet tall");
}
static void prt(String s){
System.out.println(s);
}
}
public class Overloading{
public static void main(String[] args){
for(int i=0;i<5;i++){
Tree t=new Tree(i);
t.info();
t.info("overloading method");
}
new Tree();
}
}
请各位大侠提点!!