Consider the following code Char c='a'; switch(c) { case 'a': System out println("A"); case 'b': System out println("B"); default: System .out.println("c"));
which of the following statement is true for he above code?
Output will be A
Output will be A followed by B
Output will be A,followed by B,and then following C
Will not compile
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 Value is placed in awk?
int x=5,y=19; awk=y-x>x-y?Y-x:X-Y;
5
19
14
-14
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
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 a Java program?
Set of commands
Set of statements
Set of system calls
Set of operators
How many choices are possible when using a single if else statement.
1
2
3
Many choices
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 is the buit-in multiway decision statement in Java?
if
else if
switch
loop
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