Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

why use accessor methods?

843785Nov 30 2008 — edited Dec 1 2008
ok so i am a complete beginner to java, and the book im reading on it just introduced accessor methods. my question is whats the point in using them? why not just make all the variables public and use things like myClass.myVariable = value? to me they just seem like a time waster for both the programmer and the computer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 29 2008
Added on Nov 30 2008
16 comments
891 views