day01--java中的关键字和标识符(命名规则)
This commit is contained in:
@@ -12,6 +12,21 @@ public class HelloWorld {
|
|||||||
main:方法名,固定名称
|
main:方法名,固定名称
|
||||||
(String[] args):参数列表,暂且照抄
|
(String[] args):参数列表,暂且照抄
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
关键字:就是在java中已经定义好的,具有特殊意义的单词,
|
||||||
|
|
||||||
|
标识符:起到标识作用,起名的意思
|
||||||
|
硬性要求:
|
||||||
|
1.标识符的内容只能值:0-9 a-z A-Z $ _
|
||||||
|
2.数字不能开头
|
||||||
|
3.关键字不能作为标识符
|
||||||
|
命名规范:软性建议
|
||||||
|
类名规范:首字母大写,后面每个单词首字母大写(大驼峰式)。
|
||||||
|
方法名规范: 首字母小写,后面每个单词首字母大写(小驼峰式)。
|
||||||
|
变量名规范:全部小写。
|
||||||
|
*/
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
//在控制台输出一段内容
|
//在控制台输出一段内容
|
||||||
System.out.println("你好,java1");
|
System.out.println("你好,java1");
|
||||||
|
|||||||
Reference in New Issue
Block a user