간단한 재귀하나 해보자
Posted 2015. 4. 1. 10:08package Class;
import java.sql.Struct;
import java.util.*;
public class FactorialEx{
public static void main( String[] args ){
System.out.println( factorial(4) );
}
private static int factorial(int i) {
return ( i == 0)?1:i*factorial(i-1);
}
}
- Filed under : Java !!!