Question: Question: Consider the following classes: public class Student Intsib String name: double fees public Student/int stdi, String name, double fees) this.stist this.name name: this feesfees
Question: Consider the following classes: public class Student Intsib String name: double fees public Student/int stdi, String name, double fees) this.stist this.name name: this feesfees 10 ) 12 public Studentor this(202010021, Husain",10001 1 public double discount double fees 17 If fees>1000) 10 return fees"0.1; 10 else return public double discount int sti) Isti 2018) return fees'0.05 else return 27 ) public class Student extends Student / public double discount double fees) return super fees-0.15 Answer the following questions: (12+8+8+ 12) In class Student, (stdID) variable: Can we access it from BScStudent? Explain the mechanism. 2. From the code above, give an example of Dynamic Binding, Explain your answer. Explain how to prevent class other classes from extending BScClass? Explain the difference between discount methods in class Student line 16 and the discount method in class BScStudent in line 47
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
