Question: Create an interface Printer with a default method printMessage ( ) . 2 . In the Printer interface, provide a default implementation that prints Printing
Create an interface Printer with a default method printMessage
In the Printer interface, provide a default implementation that prints "Printing
message from Printer interface.".
Create a class InkjetPrinter that implements the Printer interface and overrides
printMessage to print a different message.
Create a class LaserPrinter that does not override the printMessage method.
Write a main method to demonstrate how default methods work.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
