开发者

Why do many android classes (examples and source) begin with "m"?

I have been looking over some of the android source, and the examples given in the Dev guide, and I notice that many of their classes begin with the letter m, as in the example below:

    // Create an anonymous implementation of OnClickListener
private OnClickListen开发者_如何学JAVAer mCorkyListener = new OnClickListener() {
    public void onClick(View v) {
      // do something when the button is clicked
    }
};

From this page: http://developer.android.com/guide/topics/ui/ui-events.html

What does the m signify?


The prefix 'm' is a naming convention used to denote private member variables and methods.

Various communities no longer use this convention, but apparently the person(s) who created the android documentation still follow that convention.


Well, the class doesn't begin with an "m", the variable name does. It's just a convention used to indicate that this is a member variable

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜