不捕獲返回值的方法的值有什麼影響?Java返回問題
它像新開發的內存問題併發症如果返回值沒有抓到。
實施例的代碼片斷:
//reference types
public Object[] thismethodreturnsvalue(){
return new Object[]{new Object(),new Object(),new Object()};
}
//primitive types
public int thismethodreturnsint(){
return -1;
}
public static void main(String a[]){
thismethodreturnsvalue();
thismethodreturnsint();
}
感謝您的生動解答。非常感謝。 – 2011-02-24 22:35:27