class Employee
{
String name;
int age;
double salary;
public Employee(String name, int age, double salary)
{
this.name = name;
this.age = age;
this.salary = salary;
}
public void displayEmployeeInfo()
{
System.out.println("Employee Name: " + this.name);
System.out.println("Employee Age: " + this.age);
System.out.println("Employee Salary: " + this.salary);
}
public void increaseSalary(double increment)
{
this.salary += increment;
System.out.println("Salary after increase: " + this.salary);
}
public Employee(String name, int age)
{
this(name, age, 50000);
System.out.println("Employee object created with default salary.");
}
}
public class Main
{
public static void main(String[] args)
{
Employee emp1 = new Employee("John Doe", 30, 60000);
emp1.displayEmployeeInfo();
emp1.increaseSalary(5000);
System.out.println();
Employee emp2 = new Employee("Jane Smith", 28);
emp2.displayEmployeeInfo();
}
}