It is currently Thu, 20 Sep 2018 02:43:22 GMT



 
Author Message
 Getting user's input into the if statement
Hi all,

I would like to know, how to get integer input from the user and then put it
into the if(statement). Here what I've been trying to do:

int y = 7;

try{

   BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
   System.out.println("Please enter the number: ");
   in.readLine();

   //in.close();

   if(in.readLine().isEqual(y)){   /*I've got error message "cannot resolve
symbol" on this part*/
   System.exit(0);
  }
   }
   catch(IOException ioe) {;}
     }



 Tue, 23 Aug 2005 12:37:09 GMT   
 
   [ 1 post ] 

Similar Threads

1. getting input from user in UNIX script

2. Getting user input

3. Getting user input on same line

4. getting user input with timeout

5. getting user input with timeout

6. Getting user input in csh on SCO Unix

7. Getting user input during the boot process

8. getting user input non-blocking

9. case statement to validate input

10. Getting the IP address of a 'rlogin'ed user


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software