Solved

Which of the Following Performs the Same Way as the Switch

Question 106

Multiple Choice

Which of the following performs the same way as the switch statement below?
switch (value)
{
case 1: System.out.print ("Small") ;
break;
case 10: System.out. print ("Large") ;
break;
default: System.out. print ("Other") ;
break;
}


A) If (value ==1 ) System.out.print ("Small") ;
else if (value ==10) System.out.print("Large") ;
else System. out.print("Other") ;
B) If (value ==1 ) System. out.print ("Small") ;
if (value ==10 ) System.out.print ("Large") ;
else System. out.print("Other") ;
C) if (value >=10) System.out.print("Large") ;
else System. out. print ("Other") ;
D) if (value >=10 ) System.out. print ("Large") ;
else System. out. print ("Other") ;

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