Computer Applications
Differentiate between pure and impure methods.
User Defined Methods
ICSE 2009
142 Likes
Answer
Pure method | Impure method |
---|---|
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. |
Answered By
80 Likes
Related Questions
What happens when a method is passed by reference? Explain.
In what situation does a method return a value?
Write a method which is used to swap the values of two memory locations by using a third variable.
Write a method which is used to swap the values of two memory locations without using a third variable.