Page 94 - CA_Blue( J )_Class10
P. 94

MIND DRILL





                   Solved Questions



              A.  Tick ( ) the correct answer.
                  1.  How many ways are there to input data in Java programming?
                    a.  1                                           b.  2
                    c.  3                                           d.  4
                  2.  The expression 5/0 will give a ………………… error.
                    a.  Syntax                                      b.  Runtime
                    c.  Logical                                     d.  Underflow
                  3.  Which type of error will give the following expression?
                    Int a = 5;
                    a.  Syntax                                      b.  Runtime
                    c.  Logical                                     d.  None
                  4.  Which of the following is used to start a single line comment?
                    a.  //                                          b.  /*
                    c.  /**                                         d.  None
                  5.  Which type of input can be taken using the nextInt( ) method?
                    a.  real                                        b.  float
                    c.  boolean                                     d.  integer
                  6.  Which of the following values can be input using the nextLine( ) method?
                    a.  word                                        b.  sentence
                    c.  both a and b                                d.  None of these
                  7.  The (char)(br.read()) method is used to take a ………………… as input.
                    a.  word                                        b.  sentence
                    c.  character                                   d.  integer
                  8.  Which of following values can be taken using the Double.parseDouble(br.readLine()) method?
                    a.  6                                           b.  5.6
                    c.  ‘A’                                         d.  "India"
                  9.  Which of the following packages is required to use the Scanner class?
                    a.  java.io                                     b.  java.util
                    c.  java.scanner                                d.  java.scan
                 10.  Which of the following class is used to handle all exceptions in Java?
                    a.  Throws                                      b.  Error
                    c.  Scanner                                     d.  Exception

                Answers
                1. c    2. b     3. a    4. a     5. d    6. c     7. c     8. b    9. b     10. d

              B.  Fill in the blanks.
                  1.  To use the next() method we need to import ………………… package.

                  2.  To input a double value through Scanner class, we use ………………… method.
                  3.  To input a ………………… value through the Scanner class, we use nextFloat() method.
                  4.  The ………………… is the block where statements are written which may produce some error.
                  5.  The ………………… block is used to handle the exception that has been generated in the try block.


                9292  Touchpad Computer Applications-X
   89   90   91   92   93   94   95   96   97   98   99