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

Android

Question about classes.

For example, this line here:

private CrystalBall mCrystallBall = new CrystalBall();

Why exist the "m" before CrystalBall?

3 Answers

that doesn't seem right. it looks like it may have been myCrystalBall, which would make more sense

Regardless, that mCrystalBall is simply the name of an object of type CystalBall. it could have been named anything ie

   private CrystalBall someRandomName = new CrystalBall();

and you would then use that name whenever you wanted to reference that specific object

Ooh, now I understand, thanks :D

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Check out the 5:15 mark in this video which explains why we put a lowercase "m" in front of certain variable names. :)