Results 1 to 2 of 2
  1. #1
    danny000 is offline Member
    Join Date
    Jul 2007
    Posts
    2
    Rep Power
    0

    Default Accept 2 values ....

    im making a pogram should prompt for and accept 2 values from the user.
    How can i make a message and code telling that the user should enter 2 values when the user enters only 1 value?

    Thanks!

  2. #2
    brianhks is offline Senior Member
    Join Date
    Jul 2007
    Posts
    135
    Rep Power
    0

    Default

    Java Code:
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    System.out.pritnln("give me the first one");
    String first = br.readLine();
    System.out.println("give me the second one");
    String second = br.readLine();
    That will ask the user for two values and get both of them.

Similar Threads

  1. Replies: 4
    Last Post: 04-15-2008, 01:04 PM
  2. Replies: 1
    Last Post: 11-07-2007, 02:17 PM
  3. variable to accept a single object
    By Rgfirefly24 in forum New To Java
    Replies: 1
    Last Post: 08-06-2007, 04:41 AM
  4. freezing when use socket.accept() inside of a thread
    By tamayo in forum Advanced Java
    Replies: 0
    Last Post: 07-23-2007, 11:48 PM
  5. Passing the Values
    By Lagarto in forum JDBC
    Replies: 1
    Last Post: 07-16-2007, 03:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •