2
I have this code to read one txt
and would like to return later a string with the txt
all copied , but this algorithm it just read the lines and goes showing how to return all the content it read in a variable string?
public static void main (String[]args){
String linha = null;
try{
BufferedReader br = new BufferedReader(new FileReader("c:/algoritmo.txt"));
while(br.ready()){
linha= br.readLine();
System.out.println(linha);
}
br.close();
}catch(IOException ioe){
ioe.printStackTrace();
}
System.out.println());}
}