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

前端 未结 5 1955
我在风中等你
我在风中等你 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:43

    You should try something like this

    List xx= (List) list.get(0)
    String id = (String) xx.get(0)
    

    or if you have a House value object the result of the query is of the same type, then

    House myhouse = (House) list.get(0);
    

提交回复
热议问题