Question: What should you do with data fields of your class that represent attributes of a real world object ? A - Make them all public
What should you do with data fields of your class that represent attributes of a real world object ?
| A - | Make them all public always | |
| B - Always make them private, provide accessors and/or mutators depending on Use cases that access those objects | ||
| C - | Just never make them public and never provided accessors and mutators ever. | |
| D- | Make them private, provide accessors and/or mutators depending on need, BUT move them to public if needed |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
