This illustration shows a public class Employee with two fields - id and lastName - and two methods - getId and setId. A new instance of the Employee class is created when executing a constructor with an appropriate employee identifier and last name, as follows:
Employee emp = new Employee(215 63 2179, Smith);
This example shows two new Employee instances created with the following values: