System.in question

S

samhng

A code section:

System.out.println("Reading from standard input...");
eg1 t = new eg1(System.in);

I have no idea how to terminate the input to let the program continue
to do the rest of its job.

Anyone comes to my responds? Thanks!
 
G

Guest

A code section:

System.out.println("Reading from standard input...");
eg1 t = new eg1(System.in);

I have no idea how to terminate the input to let the program continue
to do the rest of its job.

Anyone comes to my responds? Thanks!
Maybe with Scanner-class? Get a line from terminal;

Scanner sc = new Scanner(System.in);
sc.useDelimiter("\n");
String line = sc.next();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top