Answer the question
In order to leave comments, you need to log in
Your opinion. What is the best input method?
I am learning to write in Java. I enter data from the keyboard using Scanner, today my classmate said that he uses some kind of "buffer", and said that he seems to be the best.
And then it became interesting to me, which input method is the best in your opinion, what do you use?
Answer the question
In order to leave comments, you need to log in
Answer: none.
In Java, console input is almost never used and is offered for study only for educational purposes.
About the buffer:
It looks like this
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s = reader.readLine();
BufferedReader reader = new BufferedReader(new FileReader("input.txt"));
String s = reader.readLine();
The best one is the one that is better suited for this task, a classmate tells you nonsense, usually it doesn’t matter at all, so I use the one that comes to hand.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question