Question: Q 9 . Consider the Java interface defined below. According to this definition, if a class declares that it is Printable, then it must implement
Q Consider the Java interface defined below. According to this definition, if a class declares that it is Printable, then it must implement a print method. public interface Printable void print; Write two simple classes Test and Test which implement the Printable interface. Q Using your Test and Test classes of Q implement a method in a new test class, void printAllPrintable printables which takes an array of Printable references and calls print on e XM ach reference in the array. The array passed in to printAll should be composed of a mixture of Test and Test objects.
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
