Solve the OOP scenario problem of creating a Class in c#
Hi,I've a common class Employee with members Id, Name, DeptId, ManagerId, List<Projects>, List<People>(people who work under him) and has the public methods GetEmployee(), GetProjects().
i. How to map this employee to multiple departments?
ii. Can we make this Employee class Static? If yes, Why?
If No, can we make class methods Static?
iii. If we make class methods Static, what is the output of below:
Employee emp = new Employee({Id=1,…});
Employee.GetEmployee();
Employee.GetProjects();
Employee emp1 = new Employee({Id=2,…});
Employee.GetEmployee();
Employee.GetProjects();
Which value will we get finally EmpId=1's data or Id=2's data?
iv. Can we make this Employee class Abstract so that this be a base class for all its
related subclasses to provide common functionality? or a normal class which is
inherited by all its related subclasses?
v. Why should we go for Abstract class? and difference between making Employee class
Abstract to inherit methods and making Employee class public to get inherited by
subclasses?
Please explain me this scenario in OOP environment...
