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 trialSiim Kustassoo
13,587 PointsMeaning on %n and %d in code
In For Loops code Craig used %d and %n. How does witch one does the i need to replace %d or %n.
2 Answers
Steven Stanton
59,998 PointsSorry - yes %s should be used for Strings and %d is for integers. (My mistake). For further info you can check the documentation here: https://docs.oracle.com/javase/tutorial/java/data/numberformat.html
Bjørn Nielsen
257 PointsI keep getting a Exception in thread "main" java.lang.NullPointerException at MiniGolf.main(MiniGolf.java:16) When typing in the exact same codes in Eclipse. Can someone help me?
Caleb Kleveter
Treehouse Moderator 37,862 PointsCaleb Kleveter
Treehouse Moderator 37,862 PointsAs a note on grammar, 'witch' is an evil lady, 'which' is in context of a question.