Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
if (condition) { } else { }
when (expression) { case value -> statements }
switch (expression) { case value: statements; default: statements; }
None of the above.
It is used to check multiple conditions.
It is similar to the switch statement in Java.
It can be used as a replacement for if-else and switch statements.
All of the above.
if (condition) { }
To check multiple conditions.
To return a value based on a condition.
To execute a block of code if a condition is true.
It is used to check if a variable is null.
It can be used as a replacement for the if-else statement.
It can be nested within other conditional statements.
switch (expression) { case value: statements; break; default: statements; }
switch (expression) { case value: statements; break; default: }
switch (expression) { case value: statements; default: }
if
else
switch
none of the above
To execute a block of code if the "if" condition is true.
To execute a block of code if the "if" condition is false.