青草味的懒羊羊  
标识符

Java所有的组成部分都需要名字。类名、变量、变量名以及方法名都被成为标识符

  1. 所有的标识符都应以字母(A-Z a-z)、下划线(_)、美元符号($)开头

  2. 首字符之后可以是字母(A-Z a-z)、下划线(_)、美元符号($)或者数字的任何字符

  3. 不能使用关键字作为变量名或者是方法名

  4. 标识符区分大小写

  5. 可以使用中文或者是拼音,不建议,low

    String Ahello = "qll";
    String ahello = "qll";
    String _hello = "qll";
    String $hello = "qll";
    
    String $1 = "qll";
    
    //大小写铭感(区分大小写)
    String Main ="qll";
    String main = "all";
    
    String 王者荣耀="最强王者";
    System.out.println(王者荣耀);
    
关键字

abstract、assert、boolean、break、byte、case、catch、char、class、const、continue、default、do、double、else、enum、extends、final、finally、float、for、goto、if、implements、import、instanceof、int、interface、long、native、new、package、private、protected、public、return、strictfp、short、static、super、switch、synchronized、this、throw、throws、transient、try、void、volatile、while

posted on 2021-09-04 23:16  青草味的懒羊羊  阅读(33)  评论(0编辑  收藏  举报