Since two scanners didn't fix it, roll back to having just one.
The code in your last post should run OK - what exactly happens when you run it?
that what's happen
Enter 3 values:
Exception in thread "main" java.lang.NumberFormatException: For input string: ""
OK. That tells you the problem is nothing to do with your Scanner.
It's always important to read carefully what the Exception messages say. They usually tell you exactly what the problem is and where. In this case:
It's a NumberFormatException. You can look that up in the API JavaDoc to find exactly what it means. In this case, tried to parse a String as an integer but the String did not have the right format for a number because it was empty ("").
It happened in the Integer.parseInt method which you called at line 14 of your main method of IP2HC_Inspect.
(No, I'm not psychic - all that is in the error message you posted.)
That should be enough info for you to be able to find your problem.
ps: Typed that before I saw your later post without the Exception. So now you enter two lines (and a blank line I presume?) and your program terminates without error. Not much I can do about that.
Put lots of print statements into your code so you can see which blocks of code are being executed and what the values of your variables are. If you do enough of these you will find your problem.
sooooooooooo much thanks, it was solved, i do that
Scanner keyboard = new Scanner(System.in);
String IP = keyboard.nextLine();
String TTL = keyboard.nextLine();
String conntype = keyboard.nextLine();
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"