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,335
Messages
2,571,765
Members
48,558
Latest member
herrymithen

Latest Threads

Top