java declare list string code example Example: java create list of strings List<MyType> myList = new ArrayList<>();