为什么Android教程中的大多数字段(类成员)都以`m'开头?
问题描述:
我知道骆驼案件规则,但我很困惑这个m规则。它代表什么?我是一个PHP开发人员。 我们使用变量的第一个字母作为类型的指示,例如'b'表示布尔值,'i'表示整数等。
I know about camel case rules, but I'm confused with this m rule. What does it stand for? I'm a PHP developer. "We" use first letters of variables as indication of type, like 'b' for boolean, 'i' for integer and so on.
事情?它代表手机吗?混合?
Is 'm' a Java thing? Does it stand for mobile? mixed?
答
此符号来自AOSP(Android开源项目)贡献者代码风格指南:
This notation comes from AOSP (Android Open Source Project) Code Style Guidelines for Contributors:
关注字段命名约定
- 非公共非静态字段名称
- 其他字段以小写字母开头。
- > Public static final fields(constants)are ALL_CAPS_WITH_UNDERSCORES。
请注意,代码贡献给Android开源项目。
Note that the linked style guide is for code to be contributed to the Android Open Source Project.
它不是各个Android应用程式代码的样式指南。