为什么调用toString方法输出的还是地址值
Course cr1=new Course("1", "shujujiegou");
courseToSelect.add(cr1);
Course temp=(Course)courseToSelect.get(0);
System.out.println(temp.toString());
System.out.println(temp.id+" "+temp.name);
Course cr1=new Course("1", "shujujiegou");
courseToSelect.add(cr1);
Course temp=(Course)courseToSelect.get(0);
System.out.println(temp.toString());
System.out.println(temp.id+" "+temp.name);
2016-11-21
举报