OOPS
November 29, 2023STQC-NIELIT SC-B 2021
November 29, 2023KVS 30-12-2018 Part B
Question 15 |
Consider the following code segment in JAVA
switch(x)
{
default;
system.out.println(“Hello”);
}
Which of the following data types are acceptable for x?
switch(x)
{
default;
system.out.println(“Hello”);
}
Which of the following data types are acceptable for x?
Byte and char | |
Long and char | |
Char and float | |
Byte and float |
Question 15 Explanation:
The possible values are either integer constant or character constant.No other data type values are allowed.
Correct Answer: A
Question 15 Explanation:
The possible values are either integer constant or character constant.No other data type values are allowed.