我想在 Java 中创建一个对象列表,但是当我打印列表时它只包含字符串值:
List<Bucketreturn> list = new ArrayList<Bucketreturn>();
Bucketreturn br=new Bucketreturn();//creates bucket objects
br.bucket_id=1004;
br.bucket_name=java;
br.item_number=4;
br.date_bucket_added="02-06-2012";
list.add(br);
System.out.println(list);
// prints only string value but I want the integer should also be printed