JDK 源碼解讀之 Number類
阿新 • • 發佈:2017-07-26
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
- The keyword
abstract
can be used on classe declaration. For exampleabstract MyClassX (…);
. - The keyword
abstract
can be used on method declaration. For exampleabstract int f (…);
. - When a class is declared
abstract
, it cannot be instantiated. - When a method is declared
abstract
, it cannot have definition. - Only abstract classes can have abstract methods. Abstract class does not necessarily require its methods to be all abstract.
JDK 源碼解讀之 Number類