Link to home
Start Free TrialLog in
Avatar of Embt
Embt

asked on

system.in question

how do I get two lines from system.in?

e.g.

BufferedReader in   = new BufferedReader(new InputStreamReader(System.in));

System.out.println("Please enter your name:");
name  = in.readLine();

System.out.println("Please enter your balance:");
balance  = in.readLine();

after "please enter your name", the system should be blocked until I enter the name and hit the return button. the "please enter your balance" shows up on the screen so I can enter the balance.

How do I do this?

ASKER CERTIFIED SOLUTION
Avatar of JonMan
JonMan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial