void天吶
阿新 • • 發佈:2019-01-14
一、概述
void是java中的關鍵字
(一般方法定義時用void修飾,表示沒有返回值)
package java.lang; /** * The {@code Void} class is an uninstantiable placeholder class to hold a * reference to the {@code Class} object representing the Java keyword * void. * * @author unascribed * @since JDK1.1 */ public final class Void { /** * The {@code Class} object representing the pseudo-type corresponding to * the keyword {@code void}. */ @SuppressWarnings("unchecked") public static final Class<Void> TYPE = (Class<Void>) Class.getPrimitiveClass("void"); /* * The Void class cannot be instantiated. */ private Void() {} }
java.lang.Void 類是一個不可例項化的佔位符類,用於儲存對錶示Java關鍵字void的Class物件的引用
二、Reference