Test Series - java

Test Number 30/64

Q: An IF-ELSE statement is also called ___.
A. Branching statement
B. Control statement
C. Block statements
D. All
Solution: Block statements are those that are usually surrounded by Braces { and }. So, a WHILE statement is also called a Block statement.
Q: An IF or ELSE IF statement accepts ___ as input before branching.
A. boolean
B. int
C. float
D. char
Solution: NO SOLUTION
Q: An IF statement in Java is also a ___ statement.
A. boolean
B. conditional
C. iterative
D. optional
Solution: NO SOLUTION
Q: Java style IF-ELSE statements are similar to ___.
A. C style
B. C++ Style
C. Both C and C++ style
D. None
Solution: NO SOLUTION
Q: State TRUE or FALSE. Every IF statement must be followed by an ELSE of ELSE-IF statement.
A. TRUE
B. FALSE
C. none
D. TRUE OR FALSE
Solution: NO SOLUTION
Q: An ELSE statement must be preceded by ___ statement in Java.
A. IF
B. ELSE IF
C. IF or ELSE IF
D. None
Solution: NO SOLUTION
Q: State TRUE or FALSE. A Single-Line comment or Multiline-comment is allowed in between if () and Left Brace ( { ).
A. FALSE
B. TRUE
C. TRUE OR FALSE
D. None
Solution: if(a>10)//testing comment
{

}
Q: State TRUE or FALSE. An IF statement code must be defined in between two Braces.
A. FALSE
B. TRUE
C. TRUE OR FALSE
D. None
Solution: Single line of code does not need Braces {}
if(a>9)
  System.out.println("NINE");
Q: State TRUE of FALSE. The code inside an ELSE statement may be surrounded by Braces.
A. FALSE
B. TRUE
C. TRUE OR FALSE
D. None
Solution: if(true)
{ }
else
{
  //code line 1
  //code line 2
}
Q: State TRUE or FALSE. An ELSE or ELSE-IF statement in Java can not exist alone without IF statement.
A. FALSE
B. TRUE
C. TRUE OR FALSE
D. None
Solution: NO SOLUTION

You Have Score    /10