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

某天闲着无聊,突然想起来为什么大家都习惯将全局变量使用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

原文地址:https://www.cnblogs.com/hackerkevin/p/5196775.html