User Profile

Collapse

Profile Sidebar

Collapse
Zoner
Zoner
Last Activity: Jul 27 '07, 07:29 AM
Joined: Jul 26 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Zoner
    replied to Orhpaned case in switch statement
    in Java
    Sorry, but i don't have the code anymore.

    Essentially, I changed the uppercase "S" in Switch to a lower case one. Then, since boolean is not allowed in switches, I had to settle with an integer. I changed the values after "case" from, for example, x>70, to just 70.

    Here is a very similar switch statement if this helps at all.

    Code:
    import java.io.*;
    import java.util.*;
    ...
    See more | Go to post

    Leave a comment:


  • Zoner
    replied to Orhpaned case in switch statement
    in Java
    That worked perfectly. Thanks for the help.
    See more | Go to post

    Leave a comment:


  • Zoner
    started a topic Orhpaned case in switch statement
    in Java

    Orhpaned case in switch statement

    Hey. This is my first post on this forum, and I'm just coming for a little help. I just started to teach myself Java yesterday, and i am having trouble writing a switch statement.

    The error:

    When I attempt to compile my program, I am told:
    test.java:12 ';' expected
    Switch(x)

    test.java:14: orphaned case
    case x>70

    Regarding the first error, everything...
    See more | Go to post
No activity results to display
Show More
Working...