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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!