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 Naming Conventions

Hi All,

I'm onto Data Structures and the naming convention for variables has changed from this.example to mExample.

Is this just to show different aspects of naming conventions?

Is there any specific reason why people use mExample or this.example or, is it just personal preference?

~Gabe

1 Answer

Ben Deitch
STAFF
Ben Deitch
Treehouse Teacher

I'm only familiar with the Android perspective, but using the m prefix is what the Android source style guide suggests. Though that's only a requirement if you want to contribute to Android's source code. Ultimately it's a personal/team preference. Though I think these days most people are opting out of the m prefix.

Thanks Ben :D