这是什么写法。你要交换的话,也是调用set方法。
赋值要用set方法,get方法是获取,修改如下:
books[j+1].setPrice(books[j].getPrice); book[j].setPrice(temp);