fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. class Ideone
  8. {
  9. public static void main (String[] args) throws java.lang.Exception
  10. {
  11. int value = 12345;
  12. ArrayList<Integer> array = new ArrayList<>();
  13.  
  14. for(char c : Integer.toString(value).toCharArray())
  15. array.add(Integer.parseInt(Character.toString(c)));
  16.  
  17. for(Integer each : array){
  18. System.out.println(each +" ...");
  19. }
  20. }
  21. }
Success #stdin #stdout 0.1s 320256KB
stdin
Standard input is empty
stdout
1 ...
2 ...
3 ...
4 ...
5 ...