【发布时间】:2013-10-21 11:22:25
【问题描述】:
当我尝试从数组中获取输出时,我总是得到以下输出:
test1.Buch@5ef4b65d
谁能告诉我我做错了什么?
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()) -
从 Buch 类的 Object 类中重写 toString 方法。信息 [这里][1] [1]:stackoverflow.com/questions/3615721/…