Protected vs Private w/ accessor methods

What is the difference, is there one? Or is it just preference.Thank You
[86 byte] By [java4life87a] at [2007-10-3 1:27:25]
# 1
Having a private accessor method defeats the purpose!
floundera at 2007-7-14 18:25:00 > top of Java-index,Java Essentials,Java Programming...
# 2
This question doesn't really have anything to do with accessors at all but the difference between private and protected. I think.See this http://java.sun.com/docs/books/tutorial/java/javaOO/accesscontrol.html
cotton.ma at 2007-7-14 18:25:00 > top of Java-index,Java Essentials,Java Programming...
# 3
In my Java text book, it says that you use accessor methods, but you said it defeats the purpose, so I shouldn't have accessor methods?
java4life87a at 2007-7-14 18:25:00 > top of Java-index,Java Essentials,Java Programming...
# 4
He was pointing out a mistake in your first post. The point of an accessor is to allow access to a private member variable. However, if the accessor method is private just like the field it is supposedly providing access to, then there really is no point!
TimFreya at 2007-7-14 18:25:00 > top of Java-index,Java Essentials,Java Programming...