java switch statement

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • udarassl
    New Member
    • Jan 2008
    • 1

    #1

    java switch statement

    float,char,stri ng
    which of above data types works with switch statements in java????
  • mia023
    New Member
    • May 2007
    • 89

    #2
    Originally posted by udarassl
    float,char,stri ng
    which of above data types works with switch statements in java????
    A switch works with the byte, short, char, and int primitive data types.
    Don't forget to break after each statement

    Comment

    • dmjpro
      Top Contributor
      • Jan 2007
      • 2476

      #3
      Originally posted by udarassl
      float,char,stri ng
      which of above data types works with switch statements in java????
      Switch does not work with float and String.

      Debasis Jana

      Comment

      • BigDaddyLH
        Recognized Expert Top Contributor
        • Dec 2007
        • 1216

        #4
        Originally posted by udarassl
        float,char,stri ng
        which of above data types works with switch statements in java????
        Why didn't you just try it and see? You would have found the answer much faster than waiting for a forum reply (which may have been wrong, too!) and you would have learned something even more valuable -- how to discover answers yourself!

        Comment

        Working...