protected fields

S

saneman

Are protected fields not only relevant when using inheritance?

I am currently changing some code that use inheritance to code that does not
use inheritance and don't see the point in keeping the fields protected.
 
J

Jianwei Sun

Hello saneman,
Are protected fields not only relevant when using inheritance?

I am currently changing some code that use inheritance to code that
does not use inheritance and don't see the point in keeping the fields
protected.

Yes, and you may want to change it to private.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,170
Messages
2,570,927
Members
47,469
Latest member
benny001

Latest Threads

Top