Saturday 15 January 2011

osx - How do I input a text file directly into Java? -



osx - How do I input a text file directly into Java? -

this question has reply here:

reading in system.in - java [duplicate] 8 answers

i heard this

java mymainclass < myinputfile.txt

will provide file input java program.

but how access input?

that command piping file stdin, in java can access system.in.

for example, if want utilize scanner:

scanner input = new scanner(system.in);

java osx terminal

No comments:

Post a Comment