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 trialJacob Klug
469 PointsWhy did craig put this symbol } after he wrote console.printf(" next slide");
Little confused on what these bracets do { } and why craig put a closing braket } after he wrote console.printf(" Next Slide");
2 Answers
Vithushan Elangovan
2,740 PointsOne bracket is for closing of the while loop, another is the closing bracket for the public static void (also known as the main method/function) line and another for the class (the public class line).
Raffael Dettling
32,999 PointsI think you mean the closing } of the main fucntion the while loop is already closed^^
Raffael Dettling
32,999 PointsYou can see that on 6:19 both braces are highlighted yellow^^
Nathan Huls
5,709 PointsNathan Huls
5,709 PointsI'm also confused by this. I understand the brackets open/close a block of code, but why is this block of code opened with a { and then closed three times?