Home » Android » android – What does the "m" stand for in java code

android – What does the "m" stand for in java code

Posted by: admin June 15, 2020 Leave a comment

Questions:

What does the “m” mean when it is put as a prefix before a word in android programming particularly in android java class files? I have lately been seeing it a lot in my generated main activity. Where can you use “m” as a prefix for statements/terms in programming?
Like in the examples below:

mUserLearnedDrawer
mCurrentSelectedPosition
mFromSavedInstanceState
mUserLearnedDrawer
How to&Answers:

Letter m as prefix means that it is member of class.
Letters lv means that it is local variable.
Letters pm means that it is parameter.

example:

class Example
{
  Integer mMemberOfClass;

  public void someMethod(Object pmSomeParameter)
  {
    Integer lvSomeLocalVariable;

  }

}

Answer:

Simply it means this variable is member of the class.