Advertisements
Advertisements
Question
Which of the following data type cannot be used with switch case construct?
Options
int
char
String
Double
MCQ
Advertisements
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?
APPEARS IN
RELATED QUESTIONS
_______ statement can be used as alterative to if-else statement.
Which statement in switch case is used to exit the statement once the appropriate choice is found?
Which of the following is not a branching statement?
What will be the output for the following snippet:
For (var n=0; n<10; n++)
{
if (n==3)
{
break;
}
document write (n+”<br>”);
}The _______ statement is especially useful when testing all the possible results of an expression.
<script type=“text/javascript”>
x = 6 + “3”;
document.write(x);
</script>
what will be the output?
What is meant by conditional statements in JavaScript?
Explain switch case statement with example.
Rewrite the following code using the if-else statement:
int m = 400;
double cl). = (m>300) ? (m/10.0) * 2; (m/20.0) - 2;Which of the following is not true with regards to a switch statement?
