3 ms·
> But how often do you read stdin in Java? Doesn't matter. For this problem it is just a conveniently available InputStream. How often do you read from an Inpu
by cbsmith 13y ago
> But how often do you read stdin in Java?
Doesn't matter. For this problem it is just a conveniently available InputStream. How often do you read from an InputStream? I'd hope the answer to that isn't 0.
> I also programmed in Java for nearly a decade in the late nineties till about 2004 and have never used System.in for anything.
Okay, then change the problem to implementing this interface:
public interface Copier {
public void copy(java.io.InputStream in, java.io.PrintStream out);
}
That doesn't change the problem.
- magpi3 13y agoSure I am familiar with input streams, but we are talking about doing something from memory. One quick Google search leads to an "oh, of course that is what you would do" moment, but I am just noting that even in my Java hey day I would have needed that Google search before writing the requested code. Your interface does not change the problem, but it does phrase the problem in a more familiar way and would have been much more easy for me to respond to (in my Java hey day that is).
- cbsmith 13y ago> Sure I am familiar with input streams, but we are talking about doing something from memory. It's an online quiz. You don't have to do it from memory.