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:

  1. Call by value and Call by reference
Answer
Call by valueCall 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.
  1. Pure and Impure methods
Pure methodsImpure 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.
  1. Simple Method and Overloaded method
Simple MethodOverloaded 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.