0122 所学内容

0122所学内容

注释

单行注释//

多行注释/* */

文档注释/** */

标识符的命名规则

1.数字字母 下划线 $ 数字不能开头 开头大写

2.尽量做到见名知意

JAVA开发手册

1.不能以下划线美元符号开始结束

2.严禁使用中文和拼音与英文混合的情况

3.UpperCamelCase(大驼峰命名法)

0122 三个实例

01

public class Hello {
    public static void main(String[]args){
        System.out.println("杨元瑞"+"软件工程"+"座右铭");
    }
}

02

public class veriabledemo01 {
    public static void main(String[] args) {
        //声明
        int age=20;
        //初始化
        System.out.println("age"+age);
//      输出变量
    }
}

03

public class VeriableDemo02 {
    public static void main(String[] args) {
        int num=13;
        //由数字子字母 下划线 $开头
        /*长度没有限制但是不宜过长
        尽量做到见名知意*/
        String str="嘿嘿";
        String userName=" 张小鹏";
        String 姓名="杨志琦";
        System.out.println(userName);
        System.out.println("------------");
        System.out.println(姓名);
    }
}
posted @ 2024-01-22 17:47  恶龙山二霸  阅读(31)  评论(0)    收藏  举报