Search:

Type: Posts; User: william

Search: Search took 0.24 seconds.

  1. Re: using java.util.InputMismatchException with try

    removed to stay on topic..

    Copeg how to delete a post?
  2. Re: using java.util.InputMismatchException with try

    Im going home:: have a good night


    Scanner reader = new Scanner(System.in);

    boolean flag = true;
    int end = -10 ;

    do{
    try {
  3. Re: using java.util.InputMismatchException with try

    well I finished you answer.....

    my Outputs:

    run:
    in here
    7
    end is 7
    in here
    8
  4. Re: using java.util.InputMismatchException with try

    Its not documented cause i wrote the entire thing.

    Why would you think I don't under stand this code?

    Its junk code, I use test each component before adding it to the project. This tiny...
  5. Re: using java.util.InputMismatchException with try

    I do understand. You don't stop to read the input line when in the Reader. you never clear out the IO stream out so you always get get same input. Use a if statement in the try catch to stop this....
  6. Re: using java.util.InputMismatchException with try

    I think this is a good example for a do-while loop then, set the boolean within the if-else statements


    static int smartInputInt (){
    boolean flag=false;//<--- do one time unless turned to...
  7. Re: using java.util.InputMismatchException with try

    remove line


    flag=true;

    in your catch() method
    this way you only fall through it once. Your in a while loop while true...
Results 1 to 7 of 7