Calling the Constructor Method

From the previous example


we now call the controctor method and invoke it in the new class EmployeeExample, Here is wat we have

 public class EmployeeExample {
   public static void main(String[] args) {
     Employee lucy = new Employee("lucy", "Lecturer", "IT", "1000000.0", wage, tax,bonus);
     lucy.displayEmployeeDetails(); //constructor method
   }
 }
SHARE
  • Image
  • Image
  • Image
  • Image
  • Image

0 comments:

Post a Comment