daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Feb 21st, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. JohntSmitht23
  2. JamestJonest21
  3.    
  4. String str;
  5. int row = 0;
  6. String array[][];
  7. while ((str = br.readLine()) != null)   {
  8.     array[row] = str.split("t");
  9.     System.out.println(array[row][0]);
  10.     row++;
  11. }
  12.    
  13. int rowCount = ...;
  14. String array[][] = new String[rowCount][];
  15.    
  16. List<String[]> list = new ArrayList<String[]>();
  17. String str;
  18. while((str = br.readLine()) != null)
  19. {
  20.     String[] array = str.split("t");
  21.     list.add(array);
  22. }
  23. String[][] array2D = new String[list.size()][];
  24. list.toArray(array2D);
  25.    
  26. List<List<String>> array = new ArrayList<List<String>>();
  27. while ((str = br.readLine()) != null)   {
  28.     array.add(Arrays.asList(str.split("t")));
  29. }
  30.    
  31. final int SIZE = ...; //some value that would be the max size of the array of arrays
  32. String array[][] = new String[SIZE][];
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top