我總是得到下面的輸出,當我試圖從一個陣列輸出:陣列輸出? Java的
[email protected]
可能有人請告訴我,我做錯了什麼?
Buch[] buch = new Buch[30];
for(int i = 1; i < buch.length; i++) {
buch[i] = new Buch();
char reply;
Scanner in = new Scanner(System.in);
// input data into the Array
//.....
System.out.println(buch[i]);
'System.out.println(buch [i] .getXxx())' – 2013-10-21 11:25:39
覆蓋Buch類中Object類的toString方法。信息[這裏] [1] [1]:http://stackoverflow.com/questions/3615721/how-to-use-the-tostring-method-in-java –