Page 1 of 1

(1) abstract class, class or interface (2) Tool, Drill, or PowerDrill (3) apply(int minutes), apply(), apply(int minute

Posted: Mon Jun 06, 2022 4:55 pm
by answerhappygod
(1) abstract class, class or interface
(2) Tool, Drill, or PowerDrill
(3) apply(int minutes), apply(), apply(int minutes) {}, or
apply() {}
(4) class, interface, abstract class
(5) void turnOff() or void turnOn()
(6) void turnOff() or void turnOn()
(7) interface, class, abstract class
(8) implements or extends
(9) extends or implements
(10) protected void apply (int minutes) , private void apply
(int minutes), or public void apply (int minutes)
1 Abstract Class Class Or Interface 2 Tool Drill Or Powerdrill 3 Apply Int Minutes Apply Apply Int Minute 1
1 Abstract Class Class Or Interface 2 Tool Drill Or Powerdrill 3 Apply Int Minutes Apply Apply Int Minute 1 (87.55 KiB) Viewed 30 times
Instructions: Declare an interface named Tool with a single method apply. The method has a single parameter of type int named minutes but does not return any value. Implement an abstract class named Drill). The class has a boolean variable and implements two methods turnon) and turnoff). Both have no parameters and do not return any values. Implement a class named PowerDrill. The class inherits from (Drill and implements the Tool interface. The apply method outputs a message "drilling for {X} minutes" where {X} is the minutes argument that is passed to the method, e.g. "drilling for 5 minutes"! Solution public [Select] [Select] void [Select] } public [Select] boolean isOn: public [Select] this.isOn = true; } public [Select] } this.isOn false; YE PowerDrill [Select] Tool { [Select] System.out.println("drilling for " + minutes + "minutes"); Drill { } public [Select] [Select] Drill