Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
To check for a specific condition.
To execute a block of code if none of the cases match.
To execute a block of code if the switch expression is null.
None of the above.
if (condition) { } else { }
if (condition) { } else if (condition) { } else { }
switch (expression) { case value: statements; default: statements; }
unless (condition) { }
unless { } else { }
unless (condition) { } else { }
if
else
switch
none of the above
if (variable != null) { } else { }
if (variable) { } else { }
if (variable == null) { } else { }
if (variable?.let { } ) { } else { }
when (expression) { case value -> statements }
when (expression) { case value -> statements; default -> statements }
when (expression) { value -> statements }
when (expression) { value -> statements; default -> statements }
switch (expression) { case value: statements; break; default: statements; }
switch (expression) { case value: statements; break; default: }
switch (expression) { case value: statements; default: }
if (condition) { } else { } if (condition) { }
if (condition) { } if (condition) { } else { }
if { } else if { } else { }
if (condition) { }