首页 > 其他 > 详细

为什么一个类的全局变量默认以m开头?

时间:2016-02-17 23:45:47      阅读:387      评论:0      收藏:0      [点我收藏+]

某天闲着无聊,突然想起来为什么大家都习惯将全局变量使用m开头,于是追根求源,查了一些资料,虽然并不是我想要的,但是也总结一下。

在stackoverflow上就有人问:

Why do most variables in Android tutorial start with ‘m‘?

下面就有人回答是在Android源码网站里有对编码规范的描述,其中就有:

Follow Field Naming Conventions

non-public, no-static field names start with m.

static field names start with s.

other fields start with a lower case letter.

public static final fields (constants) are ALL_CAPS_WITH_UNDERSCORES.

 

网址:source.android.com/source/code-style.html

为什么一个类的全局变量默认以m开头?

原文:http://www.cnblogs.com/hackerkevin/p/5196775.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!