, true false ?
, false. , null
Is it good to have an instance variable as ex. true, then change the value to false and use this variable throughout the class? Or is this something you should conceptually avoid in terms of using instance variables?
The value true or false depends on the context of your class. No problem with him at all.
For example: you create a client object and have an instance of memeber isActive. If your design allows all clients to be active by default, then yo are correct.
source
share