collection of objects java code example Example: how to define a collection in java List list = Arrays.asList("Lars", "Simon");