Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2
switch statements in Java,C++,etc. can be thought of as more general if/else if/else statements. In a switch statement, you provide a value to compare, which is compared with the values in case statements. If they match, the corresponding block is executed. In case none of the values match, the default block, if given, is executed. Please go through the java course carefully. https://www.sololearn.com/learn/Java/2145/
23rd May 2020, 10:33 AM
Prabhakar Dev
Prabhakar Dev - avatar