Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pkgday3;
- class Employee
- {
- public void Name(String Name)
- {
- System.out.println("name of Employee :" +Name);
- }
- public void Salary(int Salary)
- {
- System.out.println("Salary of Employee:" +Salary);
- }
- }
- class Manager extends Employee
- {
- public void Department(String Department)
- {
- System.out.println("Department of Employee:" +Department);
- //Employee e=new Employee();
- }
- }
- class Executive extends Manager
- {
- public void Exe(String Exe)
- {
- System.out.println("Executive");
- }
- public static class Ques
- {
- public static void main(String[] args)
- {
- Employee e=new Employee();
- e.Name("abc");
- e.Salary(50000);
- Manager s1= new Manager();
- s1.Department("Xyz Department");
- Executive i1= new Executive();
- i1.Exe(null);
- }
- }
- }
Add Comment
Please, Sign In to add comment