ICSE Class 10 Computer Applications
Question 15 of 43
User-Defined Methods — Question 15
Back to all questions 15
Question Question 15
Differentiate between the following:
- Call by value and Call by reference
| Call by value | Call by reference |
|---|---|
| Values of actual parameters are copied to formal parameters. | Reference of actual parameters is passed to formal parameters. |
| Changes made to formal parameters are not reflected back to actual parameters. | Changes made to formal parameters are reflected back to actual parameters. |
- Pure and Impure methods
| Pure methods | Impure methods |
|---|---|
| Pure methods take objects and/or primitive data types as arguments but does not modify the objects. | Impure methods change the state of received objects. |
| Pure methods doesn't have side effects. | Impure methods have side effects. |
- Simple Method and Overloaded method
| Simple Method | Overloaded method |
|---|---|
| Simple Methods have unique names. | In case of Overloaded methods, there are two or more methods with the same name. |
| We can identify the method being invoked by looking at its name. | We need to examine the method's number and type of parameters to determine which method will be invoked. |