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

Help! This code challenge is broken!

My tests passes locally but it always errors out when I try to submit it! Please fix this!! I need to get my badges!! :O

2 Answers

Steven Parker
Steven Parker
231,248 Points

:warning: Be careful about testing a challenge in an external REPL.
If you have misunderstood the challenge, it's also very likely that you will misinterpret the results.

Remember that the challenge isn't just about creating code that runs. It must also serve a specific purpose. When you work externally you may not be testing for purpose with the same stringency that the challenge does.

If you would like help with this specific challenge, please show the code you were submitting.

Well, the challenge was to download the zipped code, run it in IntelliJ IDE, then run the submit task using Gradle.

My code for the printer task:

  public static void printChipmunksDeclaratively(List<String> chipmunks) {
    // TODO: Print out each of the chipmunks using the forEach method on Iterable
    chipmunks.forEach(s -> System.out.printf("%s! %n", s));
  }

My code for the whisperer task:

  public static void whisperSentencesDeclaratively(List<String> sentences) {
    // TODO: Use a method reference for Main.whisper in the forEach method of sentences
    sentences.forEach(Main::whisper);
  }

Did you ever find a solution to this? It's been plaguing me and many others it seems for months