Java Java Objects Meet Objects Methods

Just to clarify, the fields he is referring to is the instance variable?

Just a little confused when he refers to the variable in a class as a fields because we don't call it that in class, so I wanted to make sure.

1 Answer

Juan Naputi
Juan Naputi
1,771 Points

Yes. The variable he is referring to is a field. Depending on the language, and sometimes the person, it can vary. In Java, I've heard people mainly call them fields. But, in languages like C#, people call them fields or properties based on how they are declared. But, you are also correct in that it is an instance variable.

Thanks for the clarification!