---
title: "Cannot instantiate the type List<Integer>"
author: "testcs_dn"
date: "2014-08-09T19:14:00Z"
tags: []
slug: "cannot-instantiate-the-type-list-integer"
draft: false
lastmod: "2014-08-11T18:06:16Z"
id: 2102563
url: "https://testcs-dn.iteye.com/blog/2102563"
---

在使用java.util.List;的时候，把语句写成了：

List&lt;Integer&gt; arr = new List&lt;Integer&gt;();

导致错误：

Cannot instantiate the type List&lt;Integer&gt;

正确写法是：

List&lt;Integer&gt; arr = new ArrayList&lt;Integer&gt;();