为什么我java控制台不能输出正确的数据库数据

我在做JSP网页的时候,要查询数据库数据,我把查询方法都写好后,写了个test测试类在控制台来测试我数据库中查询到的数据,可是运行后控制台输出了这些代码
[com.entity.FoodBean@d1e89e]
[com.entity.FoodBean@d1e89e, com.entity.FoodBean@ff057f]
[com.entity.FoodBean@d1e89e, com.entity.FoodBean@ff057f, com.entity.FoodBean@c1f10e]
[com.entity.FoodBean@d1e89e, com.entity.FoodBean@ff057f, com.entity.FoodBean@c1f10e, com.entity.FoodBean@b8deef]
[com.entity.FoodBean@d1e89e, com.entity.FoodBean@ff057f, com.entity.FoodBean@c1f10e, com.entity.FoodBean@b8deef, com.entity.FoodBean@1342ba4]
[com.entity.FoodBean@d1e89e, com.entity.FoodBean@ff057f, com.entity.FoodBean@c1f10e, com.entity.FoodBean@b8deef, com.entity.FoodBean@1342ba4, com.entity.FoodBean@1d332b]
[com.entity.FoodBean@d1e89e, com.entity.FoodBean@ff057f, com.entity.FoodBean@c1f10e, com.entity.FoodBean@b8deef, com.entity.FoodBean@1342ba4, com.entity.FoodBean@1d332b, com.entity.FoodBean@10a6ae2]
[com.entity.FoodBean@d1e89e, com.entity.FoodBean@ff057f, com.entity.FoodBean@c1f10e, com.entity.FoodBean@b8deef, com.entity.FoodBean@1342ba4, com.entity.FoodBean@1d332b, com.entity.FoodBean@10a6ae2, com.entity.FoodBean@ef2c60]
[com.entity.FoodBean@d1e89e, com.entity.FoodBean@ff057f, com.entity.FoodBean@c1f10e, com.entity.FoodBean@b8deef, com.entity.FoodBean@1342ba4, com.entity.FoodBean@1d332b, com.entity.FoodBean@10a6ae2, com.entity.FoodBean@ef2c60, com.entity.FoodBean@4a6cbf]
[com.entity.FoodBean@d1e89e, com.entity.FoodBean@ff057f, com.entity.FoodBean@c1f10e, com.entity.FoodBean@b8deef, com.entity.FoodBean@1342ba4, com.entity.FoodBean@1d332b, com.entity.FoodBean@10a6ae2, com.entity.FoodBean@ef2c60, com.entity.FoodBean@4a6cbf, com.entity.FoodBean@29ab3e]
[com.entity.FoodBean@d1e89e, com.entity.FoodBean@ff057f, com.entity.FoodBean@c1f10e, com.entity.FoodBean@b8deef, com.entity.FoodBean@1342ba4, com.entity.FoodBean@1d332b, com.entity.FoodBean@10a6ae2, com.entity.FoodBean@ef2c60, com.entity.FoodBean@4a6cbf, com.entity.FoodBean@29ab3e,
省略一些相同代码...
请问是怎么回事,会解决的帮忙解答下!谢谢!!!

说明你已经得到了这些对象
因为你直接打印的是这些对象,所以他默认调用他的toString方法。
如果要打印出可以看懂的,你可以重写TOSTRING方法,或者手动foreach打印
温馨提示:内容为网友见解,仅供参考
第1个回答  2010-10-15
你写得是什么?
相似回答
大家正在搜