JDK 源码解读之 Number类
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JDK 源码解读之 Number类相关的知识,希望对你有一定的参考价值。
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类的主要内容,如果未能解决你的问题,请参考以下文章