Android Tip – How to define Getter/Setter methods?

By -

Hello All,
This is actually a tip to define Getter/Setter methods in easy way. In other terms you can say Object initialization.

You know why i thought to share this tip, just because i have seen many people defining Getter/Setter methods by their own and After getting my tip, you will call its 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 🙂

CEO & Co-Founder at SolGuruz® | Organiser @ GDG Ahmedabad | Top 0.1% over StackOverflow | 15+ years experienced Tech Consultant | Helping startups with Custom Software Development

Loading Facebook Comments ...
Loading Disqus Comments ...