// obj.java create class Employee with constructor and printer // make array of 2 Employee, initialize and print // make array of 3 Employee { , , } and loop to print public class obj { public obj() { System.out.println("obj.java running"); //create array of employee object Employee[] obj = new Employee[2] ; //create & initialize actual employee objects using constructor obj[0] = new Employee(100,"ABC"); obj[1] = new Employee(200,"XYZ"); //display the employee object data System.out.println("Employee Object 1:"); obj[0].showData(); System.out.println("Employee Object 2:"); obj[1].showData(); System.out.println(" "); Employee[] obj3 = {new Employee(110,"def"), new Employee(220,"pqr"), new Employee(120,"ghi")}; for(int i=0; i<3; i++) { obj3[i].showData(); } System.out.println(" "); System.out.println("obj.java finished"); } //Employee class with empId and name as attributes class Employee { int empId; String name; //Employee class constructor Employee(int eid, String n) { empId = eid; name = n; } public void showData() { System.out.print("EmpId = "+empId + " " + " Employee Name = "+name); System.out.println(); } } // end class employee public static void main (String[] args) { new obj(); } } // end obj.java