Answered step by step
Verified Expert Solution
Link Copied!

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);

image text in transcribed

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Transaction Processing

Authors: Philip M. Lewis, Arthur Bernstein, Michael Kifer

1st Edition

0201708728, 978-0201708721

More Books

Students also viewed these Databases questions