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 trialshaunsmith
12,145 PointsNot 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?
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);
}
}
}
one
two
four
five
six
seven
eight
nine
Process finished with exit code 0
2 Answers
Mikkel Madsen
4,229 Pointshi.
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.
shaunsmith
12,145 PointsWorked! Thank you!
Mikkel Madsen
4,229 PointsMikkel Madsen
4,229 Pointsyour welcome glad I could help. :)