KnowledgeBoat Logo

Computer Applications

Give two differences between the switch statement and the if-else statement.

Java Conditional Stmts

ICSE 2014

87 Likes

Answer

switchif-else
switch can only test if the expression is equal to any of its case constantsif-else can test for any boolean expression like less than, greater than, equal to, not equal to, etc.
It is a multiple branching flow of control statementIt is a bi-directional flow of control statement

Answered By

54 Likes


Related Questions