package test;
public class TestReturn {
public TestReturn() { } public String returnString() throws Exception{ throw new Exception(); }}在JDK1.4中能編譯通過說明在方法執行完之前創建并拋出了異常,則該函數可以不返回值。