Question: 9. Following classes are given to you. public class Employee private int age; public void setAge(int age} this.age-age: } 1/ ... other methods not shown

9. Following classes are given to you. public class Employee private int age; public void setAge(int age} this.age-age: } 1/ ... other methods not shown } public class Secretary extends Employee private int typingSpeed; public void setTyping Speed(int typing Speed) { this.typingSpeed=typingSpeed; } 1/ ... other methods not shown } In test class following object is created. Secretary s= new Secretaryo: Which of the following statements would compile? I. s.typingSpeed = 32; II. s.setTyping Speed(32); III. S.setAge(35); a) Only 11 b) II and III Only 1 d) I and 11
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
