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 trialAlex Read
991 PointsHow come final is used after public in a 'public' variable, but before 'private' in a private variable?
I just wondered why 'final' is used before 'private' when defining a private var, but after 'public' when defining a public var? Thanks ;)
1 Answer
Philip Schultz
11,437 PointsHey Alex, I had the same question, but I started playing around with it in jshell. It seems it doesn't matter which is before the other. Are you finding the same thing to be true? I found this stackoverflow conversation about it. It seems as though it technically doesn't matter, however there is a recommended guideline.
proper guidelines : public protected private abstract default static final transient volatile synchronized native strictfp
Alex Read
991 PointsAlex Read
991 PointsOh yeh just had a look! Thanks for the answer really helped me out