Question: public interface Printable { public void print(); } public class Printer { public static void printInvoice(Printable p) { System.out.println(Printing invoice); p.print(); } } public class

public interface Printable {

public void print();

}

public class Printer {

public static void printInvoice(Printable p) {

System.out.println("Printing invoice");

p.print();

}

}

public class Order implements Printable {

public void print() {

System.out.println("Order object");

}

}

public class Rental extends Transaction implements Printable {

public void print() {

System.out.println("Rental object");

}

}

(Refer to code example given above) Which of the following statements will definitely not compile?

A) Printable p = new Order();

B) Rental rental = new Rental(); Printable p = rental;

C) Printable p = new Printable();

D) Transaction t = new Rental();

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!