What is a chain of if in which the statement associated with each 'else' is an 'if'?
else if ladder
nested if...else
Switch case statement
Both a and b
What is the output of the given program? int i =-1; if (i>-2) { System.Out.Println("India"); }
else { System.out.println("America"); }
Complication error
Run time error
India
America
What is the buit-in multiway decision statement in Java?
if
else if
switch
loop
Which of the following is the general form of the conditional operator?
expression 1:expression 2?conditional expression;
conditional expression? expression 1 : expression 2;
Conditional expression:expressions?expression2;
All of them
What is the procedure followed by break statement?
Terminates the whole program.
Terminate the enclosing switch statement.
Execute the appropriate switch statement.
All of them.
What value is placed in var? var=12>9?0:1;
0
1
9
12
What is the sequence of statement contained in a pair of braces called as?
block
function
branch
Class
if (0) { System.out. println ("Sreenath"); } else { System.out.Println ("Suresh"); }
What is the output of the given program?
Syntax error
sreenath
Suresh
both a and b
What will the comparison operators in Java returns?
Boolean value
An integer
depends upon data type
Which statement is used at the end of the switch to handle all values that aren't explicitly handled by one of the case statement?
Case
Break
default
/switch