Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Android Tip – How to define Getter/Setter methods

DZone's Guide to

Android Tip – How to define Getter/Setter methods

· Java Zone ·
Free Resource

FlexNet Code Aware, a free scan tool for developers. Scan Java, NuGet, and NPM packages for open source security and open source license compliance issues.

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 :)

 

 

 Scan Java, NuGet, and NPM packages for open source security and license compliance issues. 

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}