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