java - Passing instance variables to instance methods vs. directly accessing them? -
imagine have class instance member
string instancemember; further have 4 instance methods accessing member. wondering if there real pro/con either directly accessing instance member instance methods or pass instance member parameter each of instance methods?
passing value parameter imply going perform calculation parameter value rather encapsulated value.
if going operate on encapsulated data there no reason have parameter.
Comments
Post a Comment