What is java pojo class, java bean, normal class?

Siva picture Siva · Sep 20, 2012 · Viewed 178k times · Source

Possible Duplicate:
Difference between DTO, VO, POJO, JavaBeans?

Hi please don't say my question is duplicate :-) I saw all questions but didn't understand the exact difference.

Can someone explain what is POJO, Bean, Normal Class in easy language?

Answer

Kumar Vivek Mitra picture Kumar Vivek Mitra · Sep 20, 2012
  1. Normal Class: A Java class

  2. Java Beans:

    • All properties private (use getters/setters)
    • A public no-argument constructor
    • Implements Serializable.
  3. Pojo: Plain Old Java Object is a Java object not bound by any restriction other than those forced by the Java Language Specification. I.e., a POJO should not have to

    • Extend prespecified classes
    • Implement prespecified interface
    • Contain prespecified annotations