Page 247 - CA_Blue( J )_Class10
P. 247

7.  Which of the following methods does not change the state of an object?
                        a.  Pure                                       b.  Impure
                        c.  Public                                     d.  Protected
                    8.  When the method is declared, the first line is known as the ………………….
                        a.  Return type                                b.  Return statement
                        c.  Method header                              d.  Body of method
                    9.  Which of the following keywords is used to create a static method?
                        a.  public                                     b.  protected
                        c.  static                                     d.  private
                   10.  In which of the following ways, the actual parameter and the formal parameter share the same location in the memory?
                        a.  Pass by reference                          b.  Pass by value
                        c.  Pass by address                            d.  Pass by variable
                   11.  What is a user-defined method in Java?
                        a.  A method defined by the Java Virtual Machine (JVM)
                        b.  A method predefined by the Java language
                        c.  A method defined by the user to perform a specific task
                        d.  A method provided by the Java Development Kit (JDK)
                   12.  Which keyword is used to define a method is not returning any value in Java?
                        a.  method                                     b.  func
                        c.  define                                     d.  void
                   13.  What does the "void" keyword mean in a method declaration?
                        a.  It specifies that the method is void of errors   b.  It specifies that the method returns nothing
                        c.  It specifies the method is optional        d.  It specifies the method is variable

                   14.  Which of the following is true about parameters in a method?
                        a.  Parameters are optional in method declaration   b.  Parameters are necessary for method declaration
                        c.  Parameters are used to specify the return type   d.  Parameters are used to specify the method name
                   15.  How is a method called within the same class in Java?
                        a.  Using the dot operator                     b.  Using the this keyword
                        c.  Using the method name                      d.  Using the new keyword
                  Answers
                    1. b        2. c       3. a        4. a       5. c     6. d      7. a     8. c      9. c     10. a
                  11. c      12. d     13. b     14. b     15. c

                 B.  Fill in the blanks.

                    1.  A method is also known as ………………….
                    2.  The keyword ………………… specifies that the method does not return any value.
                    3.  The ………………… are also known as built-in methods.
                    4.  The  ………………… access specifier allows only the methods of the same class to access.
                    5.  The ………………… is a part of method header containing only the name of the method along with parameter list.
                    6.  The ………………… is required if the function is returning some value.

                    7.  A ………………… is a variable list send to the methods for execution.
                    8.  A ………………… method is also known as instance method.
                    9.  An ………………… method changes the state of an object.
                   10.  If two methods with same name are created then it is called ………………….




                                                                                                                       245
                                                                                                 User-defined Methods   245
   242   243   244   245   246   247   248   249   250   251   252