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 trialvikas pal
11,563 PointsWhy we use get?
Why we use the get for making new method is it a naming convension?
1 Answer
Livia Galeazzi
Java Web Development Techdegree Graduate 21,083 PointsYes, naming methods getVariable and setVariable when those methods are used to get or set an instance variable is a naming convention. You don't have to name your methods this way, but it helps other developers understand at a glance what the method is for.
vikas pal
11,563 Pointsvikas pal
11,563 PointsThnks Livia for clearing my doubt.