How to get datas from List<Object> (Java)?

前端 未结 5 1943
我在风中等你
我在风中等你 2020-12-31 19:12

I`m new in Java and have a problem with showing data from a list of objects. I have a simple method, which should collect data across multiple tables and return it to my con

5条回答
  •  情话喂你
    2020-12-31 19:34

    For starters you aren't iterating over the result list properly, you are not using the index i at all. Try something like this:

    List list = getHouseInfo();
    for (int i=0; i
    
    

    It looks like the query reutrns a List of Arrays of Objects, because Arrays are not proper objects that override toString you need to do a cast first and then use Arrays.toString().

     List list = getHouseInfo();
    for (int i=0; i
        

    提交回复
    热议问题