0
嘗試對對象數組進行冒泡排序時,某些東西似乎讀取爲空,但它看起來不爲空 什麼是讀爲空?對象氣泡排序錯誤:空指針異常
for(int i =0; i<(count-1); i++)
{
for(int j=(i+1);i<count;j++)
{
if((books[j].getAuthor()).compareTo((books[i].getAuthor()))>0)
{
temp = books[i];
books[i] = books[j];
books[j] = temp;
}
}
}
這是令人尷尬的無以言表謝謝 – nmu 2013-03-10 12:00:39