I am doing a method involving BufferedReader and I to have use it as an input argument, can someone tell me how to use it as an input argument but initialize it outside the method?
Other thing is, how do I get the buffer to read special characterS? (eg: ´, ~)
public static List<Pacote<Pair<String, Double>>> create(
BufferedReader fileReader, int capacidadePacotes)
throws IOException {
List retorno = new ArrayList <> (6);
String s;
while ((s=fileReader.readLine())!=null){
retorno.add(parseItem(s));
}
return retorno;
}
It basically reads a file and sends it to another function that treats the text and creates objects based on that, I'm just not clear on the whole using BufferedReader as an input argument, have just used it inside the method before so I'm unclear on how to initialize it properly, probably a dumb question but I would like to know how to do it properly