Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

indraneel
2,211 PointsgetAvailableContactMethods
Hi, I am facing an error at this stage. Given below is the code.
public Set<String> getAvailableContactMethods() {
// FIXME: This should return the current contact method names.
Set <String> contactMethods = new HashSet<String>();
for (Map.Entry e : mContactMethods.entrySet()) {
contactMethods.add(e.getKey());
}
return contactMethods;
}
1 Answer

Brendon Butler
4,242 PointsAfter Map.Entry you need to add <String, String> if I'm not mistaken. If that doesn't work, please leave a comment containing your error from the "Preview" tab.
indraneel
2,211 Pointsindraneel
2,211 PointsBrendon Butler
4,242 PointsBrendon Butler
4,242 PointsSorry for the late response, I was at work. And it looks like my answer excluded what I wanted to include because it thought it was HTML code. You need to have this:
Map.Entry<String, String> e
instead of
Map.Entry e
You might have missed that in the tutorial, and there's no problem with that. That error it gave you was hard to understand even for me. I thought there was actually other problems, but I tested it and what I thought was wrong, wasn't.