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
'm' means the variable is a member variable of the class...
The this keyword refers to the current object in a method or constructor. The most common use of the this keyword is to eliminate the confusion between class attributes and parameters with the same name (because a class attribute is shadowed by a method or constructor parameter).
The >> operator is a signed right shift operator and >>> is an unsigned right shift operator. The left operands value is moved right by the number of bits specified by the right operand.
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;
}
}
Simply it means this variable is member of the class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With