Hello everyone. I really appreciate of gaining access to this site and everyone's contributions. I am a REAL beginner with No IT, computing background starting learning Java 3 mths ago.
Please anyone explain to me in plain English, what is the side effects ? My book said that if a method modifies some outside value other than its implicit parameters, we call that modification a side effect.
What is the difference between implicit parameter and explicit parameter ?
Basically a side effect is where you are changing some value that is not scoped directly to just the method, but outside the method and you change some value to something outside the method. Therefore any other method, class, or variable cannot assume that that value outside the method scope is going to be the same, there is a side effect and it can cause problems outside the method.
Say you call some other method and it still expects that that instanceVariable.mySideEffectVariable is still equal to 10, not knowing that the changeOutsideValue method changed it to 20, and therefore that other method returns an incorrect value that what is expected.