Question: 6 -
Which of the following for loop declaration is not valid?
-
for ( int i = 20; i >= 2; - -i )
-
for ( int i = 99; i >= 0; i / 9 )
-
for ( int i = 2; i <= 20; i = 2* i )
-
for ( int i = 7; i <= 77; i += 7 )
Answer:
for ( int i = 99; i >= 0; i / 9 )
Solution not available.
Question: 7 -
_______ is not a flow control statement in Java.
-
break
-
return
-
continue
-
exit
Answer:
exit
Solution not available.
Question: 8 -
What is the valid data type for variable "a" to print "Hello World"?switch(a)
{
System.out.println("Hello World");
}
-
int and float
-
byte and short
-
byte and char
-
char and long
Answer:
byte and char
Solution not available.
Question: 9 -
The break statement causes an exit from ______ loop.
-
innermost
-
break statement causes an exit from program
-
Depends on program
-
outermost
Answer:
innermost
Solution not available.
Question: 10 -
Which of the following is an iteration statement?
-
if-elseif
-
switch
-
if
-
do-while
Answer:
do-while