I have many doubts in POJO. And seek for a clear definition with a tiny example.
POJO stands for Plain Old Java Object. It is an ordinary Java object, not bound by any special restriction other than those forced by the Java Language Specification and not requiring any classpath. POJOs are used for increasing the readability and re-usability of a program.
POJO in Java stands for Plain Old Java Object. It is an ordinary object, which is not bound by any special restriction. The POJO file does not require any special classpath. It increases the readability & re-usability of a Java program. POJOs are now widely accepted due to their easy maintenance.
POJO is short for Plain old java object, an application implemented in pojo way means the logic resides in POJO with little to no boilerplate code, thus it's very portable. An PoJo application can be ported from Spring to another container with little modification.
In simpler terms, Pojo is defined as a pure data structure, containing the getter and setter fields. It has the ability to override certain methods from Object or an interface such as Serializable. They were introduced in EJB 3.0 by Sun Microsystems and are widely used since they are easy to write and understand.
POJO Plain Old Java Object. Basically a class with attributes and it's getters and setters.
public class User{
private String name;
private int age;
public void setName(String name){
this.name = name;
}
public String getName(){
return this.name;
}
//same for age
}
DOJO haven't heard of it. A JavaScript framework. :)
pojo : plain old java object
dojo : http://dojotoolkit.org/ A javascript ajax framework though has nothing to do with java
EDIT 1:
eg. for pojo class:
public Customer{
private String name;
private String surname;
public String getName(){
return name;
}
public String getSurname(){
return surname;
}
public void setName(String name){
this.name=name;
}
public void setSurname(String surname){
this.surname=surname;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With