zoukankan      html  css  js  c++  java
  • Java有多少个关键字

     
    为了方便我直接复制过来了,原文如下: 
     
    Here's a list of keywords in the Java programming language. 
    下面是Java编程语言的关键字列表。
     
    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.
     关键字const和goto语句是保留的,虽然他们目前没有使用。
     
     true, false, and null might seem like keywords, but they are actually literals; you cannot use them as identifiers in your programs.
     true,false,和null看起来是关键字,但它们实际上是字面值;你不能用它们作为程序标识符。
     

    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 

     
     
    访问控制
    1. private 私有的
    2. protected 受保护的
    3. public 公共的
    类、方法、变量の修饰符
    1. abstract 声明抽象
    2. class 类
    3. extends 扩允,继承
    4. final 终极,不可改变的
    5. implements实现
    6. interface 接口
    7. native 本地
    8. new 新,创建
    9. static 静态
    10. strictfp 严格,精准
    11. synchronized 线程,同步
    12. transient 短暂
    13. volatile 易失
    14. const
    15. assert
    程序控制语句
    1. break 跳出循环
    2. continue 继续
    3. return 返回
    4. do 运行
    5. while 循环
    6. if 如果
    7. else 反之
    8. for 循环
    9. instanceof 实例
    10. switch 开关
    11. case 返回开关里的结果
    12. default 默认
    13. goto 
    错误处理
    1. catch 处理异常
    2. finally 有没有异常都执行
    3. throw 抛出一个异常对象
    4. throws 声明一个异常可能被抛出
    5. try 捕获异常
    包相关
    1. import 引入
    2. package 包
    基本类型 
    1. boolean 布尔型
    2. byte 字节型
    3. char 字符型
    4. double 双精度,
    5. float 浮点
    6. int 整型
    7. long 长整型
    8. short 短整型
    变量引用
    1. super 父类,超类
    2. this 本类
    3. void 无返回值
    4. enum 枚举类型
    共有:3+15+13+5+2+8+4=50个关键字,全部是小写
     
    结论:
    1. const、goto 是关键字,虽然没用,但不能拿来当变量名
    2. true、false、null 不是关键字,但也不能用来当变量名
    3. friendly、sizeof 不是关键字,可以用来当变量名 
     
     
    莫问前程
  • 相关阅读:
    WCF BasicHttpBinding 安全解析(2)BasicHttpBinding安全项
    WCF BasicHttpBinding 安全解析(4)windows验证(IIS宿主)
    网页优化系列三:使用压缩后置viewstate
    向IIS请求页面时,它做了什么?!(部分转载)
    使用Odbc链接mysql时parameter参数设置
    .net中close和dispose及关闭流操作
    asp.net 解码gb2312下urlencode后的字符串
    GridView实战一:自定义分页、排序、修改、插入、删除
    实现滑动分页(微博分页方式)
    javascript实例:逐条记录停顿的走马灯
  • 原文地址:https://www.cnblogs.com/dolphin007/p/4446102.html
Copyright © 2011-2022 走看看