How many choices are possible when using a single if else statement.
1
2
3
Many choices
Which of the following statement can make decisions based on single integer value?
if
else if
cause
switch
What value is placed in choice. int a=5,b=10,c=15 choice=a>b && a>c? a:(b>c? b:c);
5
15
10
0
What is the buit-in multiway decision statement in Java?
loop
What is meant by conditional branching?
Branching based on particular condition.
Branching done if condition is true
Branching is done if condition is false
Branching takes place without any decision.
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 can be the test-expression for if in the following program? int a=12,b=21; if(?) { System.Out.Println ("A is largest"); } else { System.Out.Print ("B is largest");
}
a<b
a>b
a!=b
a!<b
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
Which of the following control expressions are valid for an if statement?
An integer expression
A boolean expression
either 1 or 2
neither 1 or 2
What will the comparison operators in Java returns?
Boolean value
An integer
depends upon data type
both a and b