I have this code to read txt
and I would like to return a string with the txt
all copied, but this algorithm it only read the lines and shows how to return all what content did it read in a string variable?
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());}
}