I have a console menu that has to read inputs a few times in different methods. I use a new BufferedReader(new InputStreamReader(System.in))
to do that. But if this reader is closed in a method it's not useable/openable again because of System.in
.
To solve this problem one possibility is to static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
so it's usable several times in different methods with Main.br.readLine();
.
Is this a good way or are there much better methods?