Side Effects of Call by Reference
Topics
Advertisements
- Pure Methods (Functions)
- Impure Methods (Functions)
CISCE: Class 10
Pure Methods (Functions):
A pure function, when invoked, does not cause any change in the state of an object. It means that there will be no change in the values of the parameters passed while calling. In general, a pure function is a returnable function.
CISCE: Class 10
Impure Methods (Functions):
Impure methods, or mutators, change the internal state of arguments or external variables. They modify actual parameters based on the object's state, potentially causing unwanted side effects. Java uses access modifiers to control and restrict these methods.
