Solved

For the Code Segment Below

Question 15

Multiple Choice

For the code segment below:
switch(q) {
Case 1:
System.out.println("apple") ;
Break;
Case 2:
System.out.println("orange") ;
Break;
Case 3:
System.out.println("banana") ;
Break;
Case 4:
System.out.println("pear") ;
Case 5:
System.out.println("grapes") ;
Default:
System.out.println("kiwi") ;
}
Which of the following values for q will result in kiwi being included in the output?


A) 2.
B) Any integer less than 1 and greater than or equal to 4.
C) 1.
D) 3.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents