employee

                Never    
Text
       
import java.util.*;
class Employee{

	String name;
	int Age;
	long Phone_number;
	String Address;
	int Salary;
	
	void print_Salary()
	{
	
		System.out.println("Salary of the Employee is:"+Salary);
		
	}

}
class Officer extends Employee{

	String Specialisation="";
	String Department;

}


class Manager extends Employee{

	String Specialisation;
	String Department;

}

class Emp_main{

	public static void main(String args[]){ 

	Officer o1=new Officer();
	 Manager m1=new Manager();
	 
	 o1.name="Officer";
	 o1.Age=42;
	 o1.Phone_number=683686;
	 o1.Address="House 22 ,kerala";
	 o1.Salary=20000;
	 o1.Specialisation="Application Analysis";
	 o1.Department="Department of Application Analysing";
	 
	 m1.name="manager";
	 m1.Age=50;
	 m1.Phone_number=983686;
	 m1.Address="Apartment 22 ,kerala";
	 m1.Salary=200000;
	 m1.Specialisation="Nueral Network";
	 m1.Department="Department of AI";
	 
	 System.out.println("Name:"+o1.name);
	  System.out.println("Age:"+o1.Age);
	   System.out.println("Phone Number:"+o1.Phone_number);
	    System.out.println("Address:"+o1.Address);
	     System.out.println("Specialisation:"+o1.Specialisation);
	     System.out.println("Department:"+o1.Department);
		o1.print_Salary();
		System.out.println();
		System.out.println();
		
		System.out.println("Name:"+m1.name);
	  System.out.println("Age:"+m1.Age);
	   System.out.println("Phone Number:"+m1.Phone_number);
	    System.out.println("Address:"+m1.Address);
	     System.out.println("Specialisation:"+m1.Specialisation);
	     System.out.println("Department:"+m1.Department);
		m1.print_Salary();
	 
}	
}

Raw Text