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 trialaminhassan
1,995 PointsWait I don't get in. What is scope and return ?
I don't understand anything from this scope concept, I also cant understand what return means. Can someone plese help me
1 Answer
Simon Coates
28,694 Pointsscope is the section of code in which a variable is able to be accessed. In java it is usually defined by the {} in which the variable is defined. The return statement is able to be used to return a value from a method (eg. return true;), or - when the function is defined as void - just end the function by returning control to the calling code (eg. return;). I posted a small demonstration of scope a while back at https://teamtreehouse.com/community/cant-understand-how-to-fix-the-bug
Simon Coates
28,694 PointsSimon Coates
28,694 PointsAlex Popian
977 PointsAlex Popian
977 PointsHow do you add code to your comment?
Simon Coates
28,694 PointsSimon Coates
28,694 Pointsto format text as code, use three backticks on the line before the code and three on the line after the code. When you write a comment, i think there should be a link for the "Markdown Cheatsheet". This explains syntax you can embed in answers or comments.
Alex Popian
977 PointsAlex Popian
977 PointsThank you and you are right about the Markdown Cheatsheet!