Plain Old Java Obect (POJO)
Plain Old Java Object is a Java Object not bound by any
restriction other than those forced by the Java language specification. POJO is
also known as Entity class .In simple way if we described about definition of
POJO class then POJO is a class which contains
getter and setter method.
How to generate getter setter methods in NetBeans ?
To generate getter setter methods is very simple NetBeans
for this purpose we use Alt + Ins key
after that window will be open and then select entity of which we want to
getter setter method ..
Following steps shows a track to achieve our target .
Step 1: Initialization of Entity
Initial entity of which we want to create Setter and Getter
method
Step 2: Press key Alt + Ins and a window open and select
Setter and Getter
Step 3: New window will be open
Step 4: Select Entity of which you want to generate Setter
and Getter method
Step 5: And finally we achieve our target and generate
Setter and Getter Method
Why Setter and Getter methods are so important?
Getter and Setter encapsulate the fields of a class by
making them accessible only through its public methods and keep the values
themselves private
Comments
Post a Comment