递归方法
public class DigitPrint {public static void printDigit(int num){if(num<9){System.out.println(num);}else{printDigit(num/10);System.out.println(num%10);}}public static void main(String[] args) {printDigit(1234);}
}
public class DigitPrint {public static void printDigit(int num){if(num<9){System.out.println(num);}else{printDigit(num/10);System.out.println(num%10);}}public static void main(String[] args) {printDigit(1234);}
}