You can try Scanner and File class, a few lines solution
try{ String content = new Scanner(new File("file.txt")).useDelimiter("\\Z").next(); System.out.println(content);}catch(FileNotFoundException e){ System.out.println("not found!");}
You can try Scanner and File class, a few lines solution
try{ String content = new Scanner(new File("file.txt")).useDelimiter("\\Z").next(); System.out.println(content);}catch(FileNotFoundException e){ System.out.println("not found!");}