Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String ReadFromFile(String nameFile) {
- String textFromFile = "";
- try {
- Scanner sc = new Scanner(new File(nameFile));
- while(sc.hasNextLine()) {
- textFromFile += sc.nextLine()+ " ";
- }
- sc.close();
- }catch (Exception e){
- System.out.println(e + "Najprawdopodobnie plik nie istnieje");
- }
- return textFromFile;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement