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) Delivering the MVP Determining if It Is Solved

Ivan Rizki
Ivan Rizki
1,063 Points

Why did Craig always use m infront of the name variable?

Sorry if this a repost question or maybe a "too late" question, but i still don't understand why did he always use m in front of the name variable?

Any help would be much appreciated guys! :)

1 Answer

Justin Horner
STAFF
Justin Horner
Treehouse Guest Teacher

Hello Ivan,

The 'm' prefix is typically used as a style guideline for variables that are not public and not static. So in this case, private fields. I believe the 'm' comes from the idea that these variables are 'member' level variables for the class.

I hope this helps.

Ivan Rizki
Ivan Rizki
1,063 Points

Ahhh i see... Thanks a lot justin.. it's helps a lot! ;)