Logo

Programming-Idioms

  • Python
  • JS
  • Java

Idiom #260 Create an empty list of strings

Declare a new list items of string elements, containing zero elements

import java.util.*;
List<String> list = new ArrayList<>();

ArrayList implements the interface List.
items = []
let items = [];
(def items '())

New implementation...
< >
programming-idioms.org