fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12.  
  13. String result[] = new String[3];
  14. result[0] = "1.50,58,20";
  15. result[1] = "1.60,60,";
  16. result[2] = "1.70,80,30";
  17.  
  18. for(String s : result){
  19.  
  20. String pessoa[];
  21. pessoa = s.split(",", 3);
  22. System.out.println(pessoa[2]);
  23.  
  24. }
  25.  
  26.  
  27. }
  28. }
Success #stdin #stdout 0.05s 711168KB
stdin
Standard input is empty
stdout
20

30