DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > Android Tip – How to define Getter/Setter methods

Android Tip – How to define Getter/Setter methods

Paresh  Mayani user avatar by
Paresh Mayani
·
May. 09, 12 · Java Zone · Interview
Like (0)
Save
Tweet
8.75K Views

Join the DZone community and get the full member experience.

Join For Free
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 :)

 

 

Android (robot)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Progressive Web Apps vs Native Apps: Differences and Similarities
  • Building a QR Code Generator with Azure Functions
  • Chopping the Monolith: The Demo
  • Build a Business-Led API Strategy and Get the Most Out of Your APIs

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo