I'm trying to read an object called Word that has a char array as attribute. I'm trying to read words from a text file (.txt), but i have a problem only with the first word. When i use my method it reads a character thats not in the word (i think its a new line or something)
Here's my method
public void read(BufferedReader f) {
numCaracteres=0;
while ((caracter != ' ')) {
caracteres[numCaracteres]=caracter;
numCaracteres++;
caracter=(char) f.read();
}
}catch (Exception e) {
System.err.println(e);
}
PS: After i write a word in the file, i separate it with the next using a blank space