Advertisements
Advertisements
प्रश्न
Differentiate between pure and impure methods.
अंतर स्पष्ट करें
उत्तर
S. No. | Pure method | Impure method |
1. | A method that returns a value to its caller module is known as a "pure method." | An impure method may not return any value. It simply modifies the state of an object during a call. |
2. | This method, often known as the "accessor method," does not modify an object's properties. | An Impure method, often known as a Mutator, modifies the state of an object. |
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 5: User - Defined Methods - EXERCISES [पृष्ठ ३३७]