상황이 아래와 같을 때:
List<ArticleDO> articleDOList = ArrayList<ArticleDO>();
articleDOList.put(..).put(..)...;
다음은 왜 컴파일 에러가 나는가?
List<ArticleVO> articleVOList = (List<ArticleVO>)articleDOList;
해결책은?
List<? extends Object> articleDOList = ArrayList<ArticleDO>();
articleDOList.put(..).put(..)...;
List<ArticleVO> articleVOList = (List<ArticleVO>)articleDOList;
List<ArticleDO> articleDOList = ArrayList<ArticleDO>();
articleDOList.put(..).put(..)...;
다음은 왜 컴파일 에러가 나는가?
List<ArticleVO> articleVOList = (List<ArticleVO>)articleDOList;
해결책은?
List<? extends Object> articleDOList = ArrayList<ArticleDO>();
articleDOList.put(..).put(..)...;
List<ArticleVO> articleVOList = (List<ArticleVO>)articleDOList;
댓글
댓글 쓰기