java create new empty list

50

create new empty list java -

List myList = new ArrayList();
or with generics (Java 7 or later)

List<MyType> myList = new ArrayList<>();
or with generics (Old java versions)

List<MyType> myList = new ArrayList<MyType>();

Comments

Submit
0 Comments