please solve fast 🙏🏼

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

please solve fast 🙏🏼

Post by answerhappygod »

please solve fast 🙏🏼
Please Solve Fast 1
Please Solve Fast 1 (243.35 KiB) Viewed 9 times
QUESTION 1 Assume that class Person has following two private data fields: private String name; private int cpr; and following constructor: public Person(String n, int c) { name = n; cpr = c; } Now, we want to write a class called Employee that inherits the properties of class Person having following two data fields: private String position; private double salary; The constructor of class Employee can be written as follows: © ª public Employee(String n, int c, String p, double s) { this(n, c); position = p; salary = m; } © b. public Employee(String n, int c, String p, double s) { super(n, c); position = p; salary = s; } Ⓒc public Employee(String n, int c, String p, double s) [Person.super(n, c); position = p; salary = s; } Od public Employee(String n, int c, String p, double s) [name = n; cpr = c; position = p; salary = s; } QUESTION 2
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply