aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Computer Basics
  • In switch-case control, the case keyword is followed by w...
Multiple choice

In switch-case control, the case keyword is followed by which type of variables?

  1. Integer and float

  2. String and float

  3. Character and string

  4. Integer or character

  5. Float and double

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Only integer or character variables are used with case keyword.

Keep practicing — related questions

  • int x = 5; int y = 2; char op = '*'; switch (op) { default : x += 1; case '+' : x += y; /*It will go to all...
  • Which of these combinations of switch expression types and case label value types are legal within a switch...
  • Which of the following data types cannot be used with switch statement?
  • The syntax of the switch statement is switch (expression) statement is true when the expression results in
  • Which of the following case constants in switch-case is/are not allowed? (a) case ‘S’: and case ‘s’: (b) ca...
  • Analyze the following program fragment: int x; double d = 1.5; switch (d) { case 1.0: x = 1; case 1.5: x = ...
  • Analyze the following program fragment: int x; double d = 1.5; switch (d) { case 1.0: x = 1; case 1.5: x = ...
  • switch(x) { default: System.out.println(Hello); } Which two are acceptable types for x? 1. byte 2. long 3. ...
Play the full quiz 🎤 Practise this topic out loud

Practice this topic

  • Programming Fundamentals (2381 questions)
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy