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

Forum statistics

Threads
473,792
Messages
2,569,639
Members
45,351
Latest member
RoxiePulli

Latest Threads

Top