Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  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][];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement