Page 249 - CA_Blue( J )_Class10
P. 249

D.  Assertion and Reasoning based questions.

                       The following questions consist of two statements – Assertion (A) and Reason (R). Answer these questions by selecting the
                        appropriate option given below:
                        a.  Both A and R are true, and R is the correct explanation of A.
                        b.  Both A and R are true, but R is not the correct explanation of A.
                        c.  A is true, but R is false.
                        d.  A is false, but R is true.
                    1.  Assertion (A): User-defined methods in Java help in modularizing the code.
                        Reason (R): Methods allow code to be broken into smaller, reusable sections, which can be called from other parts of the
                        program.

                    2.  Assertion (A): Method overloading allows a class to have more than one method with the different name.
                        Reason (R): Method overloading is achieved by defining multiple methods with the same name but with different parameters.
                    3.  Assertion (A): A method declared with the void keyword does not return a value.
                        Reason (R): The void keyword in a method declaration specifies that the method will perform a task but will not return any value.
                   Ans.  1. a    2. d    3. a


                      Unsolved Questions


                 A.  Tick ( ) the correct answer.

                    1.  An impure method is also called a ………………….
                        a.  Mutator                                    b.  Class
                        c.  Object                                     d.   Functionally dependent method

                    2.  Overloaded method ………………… written with in same class.
                        a.  should not be                              b.  cannot be
                        c.  should be                                  d.  is optionally
                    3.  Polymorphism is one of the features of ………………… programming language.
                        a.  Procedure-Oriented                         b.  High-Level
                        c.  Object-Oriented                            d.  Low-Level
                    4.  In which of the following, any change in the formal parameter will not reflect on the actual parameter?
                        a.  Pass by value                              b.  Pass by reference
                        c.  Class                                      d.  Object
                    5.  In which of the following, any change in the formal parameter while the method is executing, the actual parameter also changes?
                        a.  Pure method                                b.  Impure Method
                        c.  Pass by value                              d.  Pass by object
                    6.  What is method overloading in Java?
                        a.  Defining methods with the same name but different return types
                        b.  Defining methods with the same name but different parameters
                        c.  Defining methods with different access modifiers
                        d.  Defining methods with different names

                    7.  Which of the following is true about method overloading?
                        a.  It is not allowed in Java
                        b.  Only return type can be different in overloaded methods
                        c.  Parameters must be of the same type in overloaded methods
                        d.  Overloaded methods must have the same name



                                                                                                                       247
                                                                                                 User-defined Methods   247
   244   245   246   247   248   249   250   251   252   253   254