Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Thread: Switch

    by Norm
    Replies
    8
    Views
    1,125

    [SOLVED] Re: Switch

    Wrong. The parseInt() method converts a String to an int.
    Read the String class's API doc for methods to convert an int to a String.

    With Java 1.7 switch statements will work with Strings.
  2. Thread: Switch

    by Norm
    Replies
    8
    Views
    1,125

    [SOLVED] Re: Switch

    The call to nextInt() at line 21 is trying to read an int value from the keyboard but the user is entering something that is not a numeric value. Use the next() or nextLine() method if you want to...
  3. Thread: Switch

    by Norm
    Replies
    8
    Views
    1,125

    [SOLVED] Re: Switch

    Can you explain what the problem is?

    The message printed for the default: should include the invalid option's value.
Results 1 to 3 of 3