Question: You are given the following code that contains an interface called Printer, a class called Office and a driver. This code has errors and
You are given the following code that contains an interface called Printer, a class called Office and a driver. This code has errors and does not work. Identify the errors and explain why they are not acceptable 1 public interface Printer{ public void printColor(int color); public void turnOn(); } public class Office extends Printer { } public void printColor(int color){ System.out.println("Setting color to"+color); class Main { public static void main(String[] args) { Office o= new Office(); //turn the printer on o. turnon(); //make a report of red color int color 111 // RBG red o.printColor(111); } //do something
Step by Step Solution
There are 3 Steps involved in it
CODE public interface Printer public void printColorint color public void turnOn Inheritance Issue T... View full answer
Get step-by-step solutions from verified subject matter experts
