Java OCA OCP Practice Question 274

Question

Which of the following types are legal arguments of a switch statement?

  • A. enums
  • B. bytes
  • C. longs
  • D. floats
  • E. strings


A, B, E.

Note

The only legal arguments of switch statements are enums and primitives that are compatible with ints.

And String




PreviousNext

Related