Answered step by step
Verified Expert Solution
Question
1 Approved Answer
What is the output of the following programs public class InheritanceQ2 ( public static void main(String[] args) { CommunityMember commMem = new CommunityMember (Fahd, 12345);
What is the output of the following programs public class InheritanceQ2 ( public static void main(String[] args) { CommunityMember commMem = new CommunityMember ("Fahd", 12345); Employee employee = new Employee ("Ahmed", 12346, 5000.75E); Faculty faculty = new Faculty("Omar", 12347, 4000, 16); } } class CommunityMember { private String name; private int ID; public CommunityMember() { System.out.println("Community Member"); ) public CommunityMember (String name, int ID ! this(); this.name = name; this.ID = ID; 1 1 class Employee extends CommunityMember ! private float salary; public Employee () { System.out.println("Employee-Det"); public Employee (String name, int ID, float salary) this, salary salary: public communityMember ( System.out.println("Community Member"); } public CommunityMember (String name, int ID) { this(); this.name = name; this.ID = ID; ) class Employee extends CommunityMember { private float salary; public Employee () { System.out.println("Employee-Def"); ) public Employee (String name, int ID, float salary) { this.salary = salary; System.out.println("Employee"); 1 1 class Faculty extends Employee { private int numlours; public Faculty(String name, int ID, float salary, int numHours) { super(); this.numHours = numHours
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started