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 trialDinu Comendant
6,049 PointsWhy are we getting an error for System.out.printf/ln?
In the if statement, instead of "return" I wrote "System.out.println" and it gives me an IllegalArgumentException: bound must be positive. Why are we getting this kind of error?
Chris Tvedt
3,795 PointsIf you are talking about the if-statment in the pickLunchSpot-method, you have to return a String, as the method expect a string return. You can use system.out.println too, but you have to return a string at the end. Else you need to change the return type of the method to be void instead of String.
1 Answer
Harley Urquhart
26,203 Pointsuse "\n" for a new line, System.out.print("\n"); or System.out.println();
Harley Urquhart
26,203 Pointsalso the printf expects an argument for each placeholder string
Marie Franklin
13,358 PointsMarie Franklin
13,358 Pointsplease post your code here