• Post Reply Bookmark Topic Watch Topic
  • New Topic

getter & setter

 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Any easy way to write getters & setter in Bean, bcoz in my project write those getter & setter is taking too much time.
tia
MB
 
Sal DiStefano
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I use Eclipse or WSAD and there is functionality for generation of getter and setter methods.
check out eclipse if you don't already have it, or try the help files if you use an IDE for code generation. Here is a clip from the eclipse help file.
Generating getters and setters
The Java editor allows you to generate accessors ("getters and setters") for the fields of a type inside a compilation unit.
In the editor, select the field for which you want to generate accessors (or a type in which you want to create these methods).
Select Generate Getter and Setter from the Source pop-up menu.
A dialog will open to let you select which methods you want to create.
Select the methods and press OK.
It is really handy.
Good luck
Sal
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!