1. 程式人生 > >JDK 源碼解讀之 Number類

JDK 源碼解讀之 Number類

only ria method key tty str can pre ati



public abstract class Number implements java.io.Serializable {

  Number類有修飾符 abstract 。表明Number類定義了一些方法,並沒有具體實現,需要子類自己實現,關於abstract ,quaro上一個答案寫的很清晰:

    The “abstract” Keyword

  1. The keyword abstract can be used on classe declaration. For example abstract MyClassX (…);.
  2. The keyword abstract can be used on method declaration. For example abstract int f (…);
    .
  3. When a class is declared abstract, it cannot be instantiated.
  4. When a method is declared abstract, it cannot have definition.
  5. Only abstract classes can have abstract methods. Abstract class does not necessarily require its methods to be all abstract.

  

JDK 源碼解讀之 Number類