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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Andrew Wilkerson](https://secure.gravatar.com/avatar/e3b91dfeff9fe8207a0c474d9c491539?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Andrew Wilkerson
1,504 PointsCode not exiting when "dork" is inputted
I am unable to get the code to stop and print out the message when inputting "dork" for the noun.
String noun = console.readLine("Enter a noun: ");
if (noun.equals("dork")){
console.printf("That Language is not allowed. Exiting \n\n");
System.exit(0);
}
4 Answers
![Brendon Butler](https://uploads.teamtreehouse.com/production/profile-photos/5012422/micro_11717585_879989708759918_856057112724156357_o.jpg)
Brendon Butler
4,254 PointsI would use equalsIgnoreCase
instead of equals
. As it will make the input case insensitive. You should also use %n instead of \n as it offers more operating system versatility. Other than that. From this snippit of code, things look fine.
![Andrew Wilkerson](https://secure.gravatar.com/avatar/e3b91dfeff9fe8207a0c474d9c491539?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Andrew Wilkerson
1,504 PointsI was trying to follow along with the video, which is why I used equals, and I will keep in mind the %n, but I need t figure out why this won't work.
![Brendon Butler](https://uploads.teamtreehouse.com/production/profile-photos/5012422/micro_11717585_879989708759918_856057112724156357_o.jpg)
Brendon Butler
4,254 PointsHe actually switches to equalsIgnoreCase
and %n eventually in the tutorials. But could you post your whole code?
![Andrew Wilkerson](https://secure.gravatar.com/avatar/e3b91dfeff9fe8207a0c474d9c491539?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Andrew Wilkerson
1,504 PointsNevermind, I am used to JGRASP which saves automatically and workspace does not.
![Alan Hood](https://secure.gravatar.com/avatar/63900644cb45ebed7742c28d7f50ca6f?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Alan Hood
1,528 PointsI had same issue and spent an age looking for a mistake. Turned out I forgot to save before running.