English

Which of the following data type cannot be used with switch case construct? - Computer Applications

Advertisements
Advertisements

Question

Which of the following data type cannot be used with switch case construct?

Options

  • int

  • char

  • String

  • Double

MCQ

Solution

Double

Explanation:

  • The data type double is incompatible with all versions of Java.
  • There's a doubt. The string data type is also not usable in Java versions prior to 7.0, but it works in switches from 7.0 and above.
shaalaa.com
Introduction of Conditional Statements in Java
  Is there an error in this question or solution?
2023-2024 (February) Official
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×