nerdexam
Oracle

1Z0-803 · Question #56

Which three are valid types for switch?

The correct answer is A. int D. integer E. String. A switch works with the byte, short, char, and int primitive data types. It also works with enumerated types the String class, and a few special classes that wrap certain primitive types: Character, Byte, Short, and Integer.

Using Operators and Decision Constructs

Question

Which three are valid types for switch?

Options

  • Aint
  • Bfloat
  • Cdouble
  • Dinteger
  • EString
  • FFloat

How the community answered

(32 responses)
  • A
    91% (29)
  • C
    3% (1)
  • F
    6% (2)

Explanation

A switch works with the byte, short, char, and int primitive data types. It also works with enumerated types the String class, and a few special classes that wrap certain primitive types: Character, Byte, Short, and Integer.

Topics

#switch statement#data types#control flow

Community Discussion

No community discussion yet for this question.

Full 1Z0-803 Practice