SyntaxFix
Write A Post
Hire A Developer
Questions
Your code works. If you don't have any output, you may have "forgotten" to add some values to the list:
// add values list.add("one"); list.add("two"); // your code for (String object: list) { System.out.println(object); }