开发者

What would be "faster" when dealing with input and output?

A simple program asking for user input could use datainputstream or sca开发者_如何学Cnner. Which would be faster? Datainputstream is binary so it may be faster? Is it in opinion? I'm just curious because I'm building a program that I want to be efficient as possible.


If you are taking input from a human being you shouldn't worry about optimizing the method in which you retrieve it.

The amount of time it takes a user to type will be the only substantial bottleneck in your program. People are many times slower than computers, so don't worry about making your program fast.

What you should worry about is making it easier for people to enter data into your program. That is the only way to substantially speed up human input.

(That being said, I prefer the Scanner class for reading input from a user.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜