how to make a function get a list of strings in java code example Example: java create list of strings List<MyType> myList = new ArrayList<>();