[color=blue][align=left] 以前看的东西多,写的东西少,很少有拿出手的东西。看过了忘记了,忘记了用的时候还得从新整理,为了克服这个不好的习惯,从此开始写属于自己的博客和代码。[/align][/color]
今天看到Void类,那就从无开始吧。Void类包路径java.lang包下,注释中这么描述Void类
The Void class is an uninstantiable placeholder class to hold a
reference to the Class object representing the Java keyword
void.
中文:Void 类是一个不可实例化的占位符类,它持有对表示 Java 关键字 void 的 Class 对象的引用。
从代码可以看出Void.TYPE就是一个Class对象的引用,接下来会从java反射开始回顾知识点。
今天看到Void类,那就从无开始吧。Void类包路径java.lang包下,注释中这么描述Void类
The Void class is an uninstantiable placeholder class to hold a
reference to the Class object representing the Java keyword
void.
中文:Void 类是一个不可实例化的占位符类,它持有对表示 Java 关键字 void 的 Class 对象的引用。
/**
* The Class object representing the pseudo-type corresponding to
* the keyword void.
*/
public static final Class<Void> TYPE = Class.getPrimitiveClass("void");
从代码可以看出Void.TYPE就是一个Class对象的引用,接下来会从java反射开始回顾知识点。