Page 189 - CA_Blue( J )_Class9
P. 189

If the break statement is not written, then after executing the current case, the control goes to the next case and
                      starts executing the case. This situation is known as Fall Through.
                      System.exit(): To stop the program immediately whenever required, System.exit() is used. This command
                      terminates the currently running Java Virtual Machine (JVM).







                                                            MIND DRILL




                      Solved Questions


                 A.  Tick ( ) the correct answer.

                    1.   Normal flow of control executes according to ………………….
                        a.  Selection approach                         b.  Sequential approach
                        c.   Side wise approach                        d.  Logical approach
                    2.   ………………… depends on the condition provided.
                        a.  Conditional flow of Control                b.  Multiple branching statement
                        c.   Normal flow of control                    d.  Sequential approach
                    3.   Which statement used to handle Conditional flow of Control?
                        a.  loop                                       b.  function
                        c.   if                                        d.  compound
                    4.   Which statement is used to exit from switch case?
                        a.  continue                                   b.  break
                        c.   System.exit(-1)                           d.  return
                    5.   Which statement is used to stop a program?
                        a.  continue                                   b.  break
                        c.   System.exit(0)                            d.  return
                    6.   To check whether a variable "a" is equal to 0, the statement is ………………….
                        a.  if(a=0)                                    b.  a==0
                        c.  a=0                                        d.  a!=0
                    7.   If break is not used with switch case, then …………………..
                        a.  It is a syntax error.                      b.  Normal flow of control.
                        c.   It is Fall Through situation.             d.  It is a Logical Error.
                    8.   Which of the following is a conditional statement?
                        a.  for                                        b.  do-while
                        c.   System.out.println()                      d.  if-else
                    9.   System.exit(0) is used to …………………..
                        a.  Terminate a program                        b.  Go to the next iteration
                        c.   Exit from switch block                    d.  Print a message to the console








                                                                                     Conditional Constructs in Java  187
   184   185   186   187   188   189   190   191   192   193   194