Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Local Development Environments Exploring Your IDE Clean up this mess

Not sure what it's looking for?

It keeps asking for if I reformatted it for import java.util.*; I did reformat it. I'm not sure what it wants?

Messy.java
import java.util.*;
import java.util.Arrays;


import static java.lang.System.out;

public class Messy {
    public static void main(String[] args) {

        out.println("one");
      out.println("two");
      out.println("four");
      out.println("five");



        //Please comment out this line and
        //this line as well with a hotkey that does multi - line commenting
        List<String> numberWords = Arrays.asList("six", "seven", "eight", "nine");
        for (String numberWord : numberWords) {
            // Use the sout shortcut to write out numberWord;
            System.out.printf("",numberWords);
        }
    }
}
results.txt
one
two
four
five
six
seven
eight
nine


Process finished with exit code 0

2 Answers

hi.

your problem is that you need to remove the import java.util.*; and replace it with java.util.List; and you are missing the number three.

Messy.java:

import java.util.List;
import java.util.Arrays;


import static java.lang.System.out;

public class Messy {
    public static void main(String[] args) {



        //Please comment out this line and
        //this line as well with a hotkey that does multi - line commenting
String[] list = new String[]{"one", "two","three", "four", "five", "six", "seven", "eight", "nine"};
        List<String> numberWords = Arrays.asList (list);
        for (String numberWord : numberWords) {
            // Use the sout shortcut to write out numberWord;
            out.printf("%s",numberWord);
        }
    }
}

results.txt

"one"
"two"
"three"
"four"
"five"
"six"
"seven"
"eight"
"nine"

hope it will help, I passed with this code.

your welcome glad I could help. :)

Worked! Thank you!