Guest User

Untitled

a guest
Mar 21st, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. int garantiaDe = 0; // {1,6};
  2. int paraAcertoDe = 0; // {1,6}
  3. int cont,i,j;
  4. List<String[]> lista = new ArrayList<>();
  5.  
  6. LerArquivoTxT() {
  7. this.garantiaDe = garantiaDe;
  8. this.paraAcertoDe = paraAcertoDe;
  9. }
  10.  
  11. public void LerArquivo() {
  12.  
  13. try {
  14.  
  15. FileReader fr = new FileReader("C:/Conteudo/lista.txt");
  16. BufferedReader br = new BufferedReader(fr);
  17.  
  18. String str;
  19.  
  20. while ((str = br.readLine()) != null) {
  21. lista.add(str.split(";"));
  22.  
  23. }
  24.  
  25. } catch (IOException e) {
  26. out.println("Arquivo não encontrado!");
  27. } finally {
  28. //br.close();
  29. }
  30.  
  31. lista.forEach(a -> System.out.println(Arrays.toString(a)));
  32. }
  33.  
  34. public static void main(String[] args){
  35.  
  36. LerArquivoTxT lista = new LerArquivoTxT();
  37.  
  38. lista.LerArquivo();
  39.  
  40. }
Add Comment
Please, Sign In to add comment