VideosMy ProjectsProgramming BlogGallery
  1. Home
  2. Blog
  3. How to create an empty list in Java
Programming Blog

Atom/RSS Feed

java

How to create an empty list in Java

java

Lists in Java are pretty powerful and this is how you create them

For a list you will never populate with items

List<Integer> list = Collection.emptyList()

For a list you will add items to

List<Integer> list = new ArrayList<>()
Join my mailing list