PDA

Click to See Complete Forum and Search --> : Simple input/output question


slipper
Dec 14th, 2003, 07:19 AM
I want to ask a question and then returmn the response as a string but I am not sure how to get inputback from th user and store it as a variable.

Something like:

System.out.print("Ask the user a question?");
String response = getresponse();


How can I code the above statement?

Dillinger4
Dec 14th, 2003, 11:03 AM
import java.io.*;

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

String s = buff.readLine();