最近在看scjp的TIP。
有这几句话:
8.A transient variable may not be serialized.
9. The transient keyword is applicable to variables only.
10. The native keyword is applicable to methods only.
请问是什么意思?感觉以前看书没见到过。

解决方案 »

  1.   

    翻译成中文就是。
    8.transient变量可以不是序列化的。//不过一般transient变量都是序列化的。
    9.transient关键字只能形容变量。//呵呵,这个容易劣迹
    10.native关键字字能形容方法。//这个也是。native一般就是去调用本地方法,难道还有本地变量?不可能
      

  2.   

    A transient variable is a variable that may not be serialized. If you don't want some field to be serialized, you can  that field transient or static.
      

  3.   

    Native methods are used when the implementation of a particular method is present in language other than Java say C,C++.
    To use the native methods in java we use the keyword native
    public native method_a()
    This native keyword is signal to the java compiler that the implementation of this method is in a language other than java.
    Native methods are used whenwere alize that it would take up a lot of rework to write that piece of already existing code in other language to java.