im reading oracles notes and came across this
"You control access to classes and members in the same way: by using an access modifier such as public in their declaration."
what are members? are members and fields the same?
but we call them fields...right?
i was specifically told on this web site to refer to instance variables as fields
What website was this?
I sometimes call them instance variables and sometimes fields. On this site, I see instance variables more than fields. I was taught that a field is an instance variable with a getter and setter, but I haven't heard that definition anywhere else.
It might have been me; I think I said it is better to call instance variables instance fields. I have never heard that a field includes getter and setter, only the variable. I thought field getter and setter together were called a property, but I don't think that is an official Java® term.
Knute Snortum wrote:. . . What website was this? . . . I was taught that a field is an instance variable with a getter and setter, but I haven't heard that definition anywhere else.
The Java Language Specification defines a field as either a static or instance variable. It is not specific to instance variables.