Answered step by step
Verified Expert Solution
Question
1 Approved Answer
NEED ASAP :) . JAVA LANGUAGE PLEASE. THANK YOU ! Assume that the following classes have been created. Do not write any import statements. An
NEED ASAP :) . JAVA LANGUAGE PLEASE. THANK YOU !
Assume that the following classes have been created. Do not write any import statements. An abstract class named DVD. This class has a two private attributes: a String attribute called title and an double attribute called size in that order that are set by the constructor. for accessing the double attribute called getTitle and getSize indicate if the burning operation was successful. It has two public getter methods, one for accessing the String attribute and one It has an abstract method declared called burn that returns a String value to What you need to do: 1.) Write a sub-class of the DVD class called DualLayerDVD (Do NOT use the public keyword when declaring this class.) 2.) Your sub-class should have a private boolean attribute called readOnly. 3.) Your sub-class should have a constructor that takes three parameters: one String, a double, and a boolean in that order. You should use the same names and order as the super class when writing your constructor. 4.) The constructor should call the super class constructor using the super keyword to pass the string String parameter and the double parameter upto the super class for initialisation. 5.) The constructor should also initialise the readOnly attribute with the value passed into the constructor. 6.) You should provide a public getter method for the readOnly attribute called isReadOnly. 7.) You should provide an implementation of the abstract method that is defined in the super class. 8.) The implementation of this method should return "The DVD entitled [title of dvd] was burnt successfully: " concatenated with the opposite of the current value of the readOnly attribute. For example: (If the DVD has a title "Karma Chameleon" and its readOnly attribute is set to true) The method should return: The DVD entitled Karma Chameleon was burnt successfully: falseStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started