How many choices are possible when using a single if else statement.
1
2
3
Many choices
Which of the following is the general form of a simple 'if ' condition?
if(intialization;test condition;incremented) { statement-block; }
if (test expression) { Statement -block }
if (expression) { Statement -block; }
All of the above
What is the buit-in multiway decision statement in Java?
if
else if
switch
loop
What will the comparison operators in Java returns?
Boolean value
An integer
depends upon data type
both a and b
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
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 value is placed in var? var=12>9?0:1;
9
12
Which of the following is correct for a program that breaks sequential flow and jumps to another part of the code?
Looping
Jumping
Branching
Exit 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 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