हिंदी

Types of Method

Advertisements

Topics

  • Pure Methods (Functions) 
  • Impure Methods (Functions) 

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. 

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. 

If you would like to contribute notes or other learning material, please submit them using the button below.
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×