http://www.technotalkative.com/about/ Paresh has posted 21 posts at DZone. You can read more from them at their website. View Full User Profile

Android Tip – How to define Getter/Setter methods

05.09.2012
| 4139 views |
  • submit to reddit
Hello All,
This is a tip to define Getter/Setter methods in an easy way; Object initialization.

I'm sharing this tip because I have seen many people defining Getter/Setter methods on their own and after understanding my tip, you will consider what you did before a time wasting task :)

Now, lets come back to the point and follow the below steps to define Getter/Setter methods for a particular class.

Step 1: Open Eclipse and Create one Android project

Step 2: Create a class and declare attributes that you want for this class.

Step 3: Select these 3 attributes inside the class and right click -> source -> Generate Getters and Setters…

You are done. Enjoy programming and shortcuts :)

 

 

Published at DZone with permission of its author, Paresh Mayani. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Tags: