Q. What is the valid data type for variable "a" to print "Hello World"?

Code:
switch(a)
{
   System.out.println("Hello World");
}
  • (A) int and float
  • (B) byte and short
  • (C) char and long
  • (D) byte and char
πŸ’¬ Discuss
βœ… Correct Answer: (D) byte and char

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
105
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Sandhya Thakur
Publisher
πŸ“ˆ
99%
Success Rate