List<Object> list = getList(); return (List<Customer>) list; Compiler says: cannot cast List<Object> to List<Customer> 不能将Object集合强制转换成实体集合! you can always cast any object to any type by up-casting it to Object first. in your cas
Java Object Clone User user = new User(); user.setName("tom"); User user1 = new User(); user1.setName("jerry"); List<User> list = new ArrayList<>(); list.add(user1); user.setChildren(list); user.setUser(user1); System.out.p