help please Java , I will upvote
Posted: Fri Apr 29, 2022 7:06 am
help please Java , I will upvote
Study the constructs below and answer the questions that follow. interface Depreciable { void depreciate (double percentage); } 4 abstract class Item implements Depreciable{ protected double value; 6 8 10 12 public Item(double value) { this.value = value; } } class MultimediaItem extends Item implements Depreciable{ public MultimediaItem(double value) { super (value); } public void depreciate (double percentage) { value = value - (value (percentage / 100)); } 14 16 20 class CD extends Multimedia Item public CD (double value) { super (value); } } 24 public class Application { public static void main(String[] args) { 22 26 } The compiler will 4 in the Depreciable interface. The compiler will in the Item class. Which of the following may be added, independently, to the interface Depreciable. (Choose all that apply. Note that negative marking applies.) Oa. public abstract void setValue(double v) {} Ob. String name = "null"; Oc. double percentage; Od ; Jd. double boolean owned = true; Oe. public static double percentage; Of. int getPercentage(); = =
Which of the following may be added to the Item class (Choose all that apply. Note that negative marking applies.) Ja. protected abstract void depreciate(); Ob. protected void depreciate(double p){} Oc. c. public abstract double getValue() {} Od. public abstract Item(); De public static final int = 10; Jf. public Item () {} Og. public void setValue(double v); Which of the following may be added to the main method without causing a compile error. (Choose all that apply. Note that negative marking applies.) = = Oa. Item i = new Item(); Ob. Depreciable d = new Item(); Oc. Item i = new Multimedialtem(0); Od. Depreciable d = new CD(0); Oe. Depreciable d = new Item(0); d = new Multimedialtem(0); Of. Depreciable d = new Depreciable();d = new Item(0); =
Study the constructs below and answer the questions that follow. interface Depreciable { void depreciate (double percentage); } 4 abstract class Item implements Depreciable{ protected double value; 6 8 10 12 public Item(double value) { this.value = value; } } class MultimediaItem extends Item implements Depreciable{ public MultimediaItem(double value) { super (value); } public void depreciate (double percentage) { value = value - (value (percentage / 100)); } 14 16 20 class CD extends Multimedia Item public CD (double value) { super (value); } } 24 public class Application { public static void main(String[] args) { 22 26 } The compiler will 4 in the Depreciable interface. The compiler will in the Item class. Which of the following may be added, independently, to the interface Depreciable. (Choose all that apply. Note that negative marking applies.) Oa. public abstract void setValue(double v) {} Ob. String name = "null"; Oc. double percentage; Od ; Jd. double boolean owned = true; Oe. public static double percentage; Of. int getPercentage(); = =
Which of the following may be added to the Item class (Choose all that apply. Note that negative marking applies.) Ja. protected abstract void depreciate(); Ob. protected void depreciate(double p){} Oc. c. public abstract double getValue() {} Od. public abstract Item(); De public static final int = 10; Jf. public Item () {} Og. public void setValue(double v); Which of the following may be added to the main method without causing a compile error. (Choose all that apply. Note that negative marking applies.) = = Oa. Item i = new Item(); Ob. Depreciable d = new Item(); Oc. Item i = new Multimedialtem(0); Od. Depreciable d = new CD(0); Oe. Depreciable d = new Item(0); d = new Multimedialtem(0); Of. Depreciable d = new Depreciable();d = new Item(0); =