zoukankan      html  css  js  c++  java
  • java中的关键字

    7、以下不是java关键字的有【C】 。

    A. super   B. this   C. NULL   D. true

    正确答案是CD,今天做了一个简单的java测试题结果让我凌乱了,用了这么长时间的java,一直以为true也是java的关键字,因为用任何编辑工具里面true,false,null都是会变色的,结果今天才发现java里面认为true,false,null不是一个关键字,而是 literals字面值。这也是前sun公司规定的,没有原因,既然要玩java这个游戏就需要遵守人家的规定!

    下面是从http://docs.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html网页复制的,可以参考!

    Java Language Keywords

    Here is a list of keywords in the Java programming language. You cannot use any of the following as identifiers in your programs. The keywords const and goto are reserved, even though they are not currently used. true, false, and null might seem like keywords, but they are actually literals; you cannot use them as identifiers in your programs.

    abstract continue for new switch
    assert*** default goto* package synchronized
    boolean do if 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
    *   not used
    **   added in 1.2
    ***   added in 1.4
    ****   added in 5.0
  • 相关阅读:
    日记2014/06/25
    Cocos2dx 3.1.1 学习笔记整理(4):事件监听与Action的初步使用
    Cocos2dx 3.1.1 学习笔记整理(3):逐帧动画
    Cocos2dx 3.1.1 学习笔记整理(2):创建场景与载入图片
    Cocos2dx 3.1.1 学习笔记整理(1) 新建项目
    5-20
    5-19
    5-18
    5-17
    5-16
  • 原文地址:https://www.cnblogs.com/zfy-220/p/4285690.html
Copyright © 2011-2022 走看看