This is my code:
public static void NameLaden() throws IOException {
File f = new File(path1);
FileReader g;
g = new FileReader(f);
Name = g.read();
g.close();
}
The answer is probably really simple. The only problem I have is that he wants a int
instead of a string
for Name
. But Name
has to be a string
since its a word.
Try it like this. Did not test it, but it should work, if name is on the first line of the file.