Professional Documents
Culture Documents
Abstract Super Constructor
Abstract Super Constructor
constructor
1) Create an abstract class Singer with instance variable singername, songtitle,
with abstract method void sing() and instance methods-
setData(String singername,String ongtitle) and getData()to set the values and
fetch the values. Create Two sub classes ClassicalSinger and PlayBackSinger,
in PlayBackSinger instance variable is filmname and instance method is
setDetails(String filmname) and in ClassicalSinger instance variable name is
instrumentname and instance method-
setDetails(String instrumentname).Create getData() methods in both the sub
classes to print the values and override sing()method in both the classes.
Create one more class SingerDemo and in main method create object of
ClassicalSinger and PlayBackSinger and call all the methods.
Override calculateSalary() to calculate total salary assuming that per day salary is
300Rs by making it constant. override printDetails() to get the details .