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!
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 trial
Christopher Jow625 Points
Order 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.
Steven Couture2,106 Points
when 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!