I have a method that helps to enter information about movies, then write them in the file.
Writing a name (eg The Shawshank Redemption) in the file only writes "The".
What can I do in this case?
System.out.print("Name movie:");
String name=input.next();
input.nextLine();
System.out.print("Genre:");
String genre=input.next();
input.nextLine();
System.out.print("Country:");
String country=input.next();
Movie movie = new Movie(name, genre, country);
input.nextLine();
write(movie);
Method write()
FileWriter fw = new FileWriter("Movie.txt", true);
fw.write(i.name+" "+i.genre+" "+i.country+"\n");
fw.close();
Word is read to space, and in the .txt file only the first word to space is written