约定俗成的命名规则
类名的首字母大写
变量名和方法名的首字母小写
运用驼峰标识
[源码]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
public
class
Dog {
static
int
furColor;
float
height;
float
weight;
void
catchMouse(Mouse m) {
//as;dfj;asdf
//asdfj;asf
//m.scream();
}
public
static
void
main(String[] args) {
//int i;
System.out.println(furColor);
Dog d =
new
Dog();
Mouse m =
new
Mouse();
d.catchMouse(m);
HelloWorld hw =
new
HelloWorld();
}
}
class
Mouse {
int
height;
}
|