java keywods & reserved

本文详细介绍了Java编程语言中被保留用作关键字的字符序列,包括那些不能作为标识符使用的词汇。列举了如abstract、continue、for等关键字,并特别指出尽管目前未使用,const和goto仍被保留。此外,true、false及null虽然看似关键字,但实际上是布尔字面量和空字面量。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The following character sequences, formed from ASCII letters, are reserved for use as keywords and cannot be used as identifiers :

 

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

The keywords const and goto are reserved, even though they are not currently used. This may allow a Java compiler to produce better error messages if these C++ keywords incorrectly appear in programs.

While true and false might appear to be keywords, they are technically Boolean literals Similarly, while null might appear to be a keyword, it is technically the null literal.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值