pha*_*joe 4 java foreach entity casting
我已经跟踪了我正在开发的应用程序的问题,它给了我一个类型转换异常.有趣的是,它说不能投"实体.电影不能投给实体.电影"?!电影是一个ArrayList.
try {
movies = getMovies();
} catch (Exception e) {
e.printStackTrace(System.out);
} finally {
try {
for (Movie movie : movies) {
output.append(" <tr>\n");
output.append(" <td>" + movie.getId() + "</td>");
output.append(" </tr>\n");
}
} catch (Exception e) {
e.printStackTrace(System.out);
}
}
Run Code Online (Sandbox Code Playgroud)