Home » JAVA Programming » Decision Making » Question
  1. What is the valid data type for variable “a” to print “Interview Mania”?

    switch(p)
    {
    System.out.println("Interview Mania");
    }
    1. byte and short
    2. char and long
    3. byte and char
    4. int and float
    5. None of these
Correct Option: C

The switch condition would only meet if variable “a” is of type byte or char.



Your comments will be displayed only after manual approval.