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.
switch (expression) { case value: statements; break; default: statements; }
switch (expression) { case value: statements; break; default: }
switch (expression) { case value: statements; default: }
if (variable != null) { } else { }
if (variable) { } else { }
if (variable == null) { } else { }
if (variable?.let { } ) { } else { }
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.
All of the above.
if (condition) { } else if (condition) { } else { }
To check multiple conditions.
To execute a block of code if a condition is true.
To execute a block of code if a condition is false.
if
else
switch
none of the above
unless (condition) { }
unless { } else { }
unless (condition) { } else { }