java基础:标识符和关键字

标识符

解释:类名,变量名,以及方法名都被称为标识符

标识符有哪些

大约 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,sychronzed,

this,throw,throws,transient,try,void,volatile,while等。

注意点

1.所有的标识符都应该以字母(A-Z或者a-z),美元符($),或者下滑线开始

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

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

4.标识符是大小写敏感的

public class Demo1 {
    public static void main(String[] args) {


        String 英雄联盟="王者";
        System.out.println(英雄联盟);
        String Man="tianxia";
        String man="tianxia";

        String Ahello="tianxia";
        String hello="tianxia";
        String $hello="tianxia";
        String _hello="tianxia";
        String hello1="tianxia";


    }
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值