March 2019
Intermediate to advanced
242 pages
6h 21m
English
As a Java developer, you have probably used and created POJOs in some (or all) of your projects. A POJO is a class that encapsulates a set of data, without any additional behavior to manipulate its state. It usually includes constructors, accessors, mutators, and the overridden methods from the object class (hashCode(), equals(), and toString()). The accessors and mutators allow access and assignment to state variables. Additionally, the mutators might include code to check the range of values that are assigned to the instance state. The following is an example:
final class Emp { private String name; private int age; public Emp(String name, int age) { this.name = name; this.age = age; } // accessor methods - getName, ...Read now
Unlock full access