Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Java Objects (Retired) Meet Objects Creating Classes

Member Variable

Why did he used the term "Member Variable"?. Is it different from the other properties/fields.

I read the reference about the coding style (Adding "m" in front of the member variable). according to the reference "Non-public, non-static field names start with m" but Mr.Craig used "m" in front of a public field name. Is that wrong?

I don't exactly understand what your question is, but... First of all, Member Variable = Global Variable = public field(the term that you just talked), are all the same.

In order to make a proper class in the object oriented language like Java, all the variable should be...

  1. private(which is not public)
  2. non-static
  3. Member Variable should be in public field.

In conclusion, the reference and Mr.Craig both are right.

If you have a further question, please ask me.