Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Christopher Jow
625 PointsOrder of methods, variables, modifiers, etc.
What is the property order for method, variables, modifiers, etc.? In the video, Craig has "final private string", but above it uses "public final string" or whatever. Just wanting to know what is the best order for things to be declared.
1 Answer

Steven Couture
2,106 Pointswhen wanting to make instance variables its best to declare them after opening the class block. by making something public final means it can be used outside the class but cannot be changed after being given a value (most likely from the constructor). When its private final, it can only be used in that class and cannot be changed after given a value (most likely from the constructor)
hope this helps, just comment if you need me to explain better!
Steven Couture
2,106 PointsSteven Couture
2,106 Pointsand no it doesn't matter what order its in and its better to do it after opening the class block
Christopher Jow
625 PointsChristopher Jow
625 PointsOk. Is there an order to those? Example: integers before strings or private before public.