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

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -