java - Conditioning a String -


quick question. i'm wondering how can make run when number 2-23 entered user.

         bufferedreader in;          int x;          string playerx;           //user input number of players          in = new bufferedreader(new inputstreamreader(system.in));          system.out.println("\nwelcome casino!");          system.out.println("how many players playing? (2-23)");          //string number of players          playerx = in.readline();           //convert players integer          x = integer.valueof(playerx).intvalue();            //condition player x number of players between 2 , 23          if(playerx.compareto("1")==0 && playerx.compareto("24")==0) {             system.out.println("\nsorry, there either not enough players or not enough cards option.");         }else {  

try

  if( x< 2 ||  x >  23) {             system.out.println("\nsorry, there either not enough players or not enough cards option.");    }else {  

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -