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
coder5837
1,535 Pointswhat does the "m" before a variable do? like what is the difference between Game and mGame?
very simple very simple please
4 Answers
Kristian Terziev
28,449 PointsHello Emily.
In fact that "m" at the beginning does absolutely nothing. Its there to make it easy for you and other developers to guess that this is a member variable.
Kristian Terziev
28,449 PointsShortly a member variable is a variable that belongs to a class.
coder5837
1,535 Pointswhat is a class? and what does it mean to be a part of one?
Kristian Terziev
28,449 PointsI think you need to go through the Java courses as you miss some of the knowledge needed to understand most of the things you are asking about. Go through the courses and I guarantee you will understand those things .
prasenjeet daftuar
643 PointsStarting with letter 'm' for the member variable(variable which is part of a user defined function) is a best practice to differentiate between Member Variables and general variable(which are usually written under main function). Many Thanks!!
coder5837
1,535 Pointscoder5837
1,535 Pointswhat is a member variable? in simple terms again, please