POJO : Plain Old Java Object
1. POJO class is a simple Java class.
3. It can extends and implement from Java (JEE) language.
Examples
Example 1
1. POJO class is a simple Java class.
2. The classes that does not implement any technology/framework API interfaces and that does not extend any technology framework API classes.
3. It can extends and implement from Java (JEE) language.
Examples
Example 1
class Demo {
// implementation goes here
}
Given class is POJO because it is simple java language class
Example 2
class Demo extends HttpServlet {
// implementation goes here
}
Given class is Not POJO because it extend Servlet technology class
Example 3
class Demo implents Serializable {
// implementation goes here
}
Given class is POJO because it implement java language serializable
Example 4
@Entity
class Demo {
// implementation goes here
}
// Given class is POJO,
//if a class uses only annotation then it is POJO
Example 5
class Demo extends Test {
// implementation goes here
}
// if Test is POJO, Demo also POJO
No comments:
Post a Comment