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 trialSean Flanagan
33,235 PointsProblem pasting results
Hi. I've got a slight problem. It tells me to paste results but in the preceding video, we can't see the whole of the line starting Set<String
.
Here's my Java:
package com.teamtreehouse;
import com.sun.org.apache.xpath.internal.operations.*;
import java.lang.String;
public class Main {
public static void main(String[] args) {
// write your code here
System.out.printf("This is the classpath: %s %n",
System.getProperty("java.class.path"));
Set<String> propNames = new TreeSet<String>(System.getProperties().stringPropertyNames());
for (String propertyName : propNames) {
System.out.printf("%s is %s %n",
propertyName,
System.getProperty(propertyName));
}
}
}
And the results:
Information:Using javac 1.8.0_60 to compile java sources
Information:java: Errors occurred while compiling module 'Systemizer'
Information:07/09/2015 15:19 - Compilation completed with 2 errors and 0 warnings in 6s 303ms
C:\Users\user\IdeaProjects\Systemizer\src\com\teamtreehouse\Main.java
Error:(13, 9) java: cannot find symbol
symbol: class Set
location: class com.teamtreehouse.Main
Error:(13, 37) java: cannot find symbol
symbol: class TreeSet
location: class com.teamtreehouse.Main
I would appreciate any help. :-)
# Paste your results here
1 Answer
Steve Hunter
57,712 PointsHi Sean
You need to add two import
statements:
import java.util.Set;
import java.util.TreeSet;
At the top of your file.
I hope that helps
Steve.
Sean Flanagan
33,235 PointsSean Flanagan
33,235 PointsHi Steve. I copied and pasted the whole input and it paid off. I've marked your reply as Best Answer and upvoted it.
Thank you. :-D