java中每个对象都是某种类型的实例!
简单的递归例子!
当一个方法调用自身,这叫做递归。这种方法称为递归方法!
public class demo{
public static void main(String[] args){
countdown(3);
} //end main method
public static void countdown(int n){
if(n==0){
System.out.println("blastoff");
} else{
System.out.println(n);
countdown(n-1);
}
}//end countdown method
}//end class