Question: Which statement is true about the following code? Select the one correct answer. (a) The program will not compile. (b) The program will throw a
Which statement is true about the following code?

Select the one correct answer.
(a) The program will not compile.
(b) The program will throw a ClassCastException.
(c) The program will print: Jingle|Jingle|Jazz|Jingle|
(d) The program will print: Jingle|Jazz|Jingle|Jingle|
(e) The program will print: Jingle|Jingle|Jingle|Jazz|
interface InterfaceA { void do It(); } interface InterfaceB extends InterfaceA {} interface InterfaceC extends InterfaceB { } class Beta implements InterfaceB { public void doIt () { System.out.print("Jazz"); } void doIt (); boolean equals (Object obj); } } public class RQ12A999 { public static void main(String[] args) { InterfaceA a = () -> System.out.print("Java"); InterfaceB b = () -> System.out.print("Jive!"); InterfaceC c = () -> System.out.print ("Jingle | "); Object o = a = c; b = new Beta (); a.doIt (); b.doIt (); c.doIt (); ((InterfaceA) o).doIt (); }
Step by Step Solution
3.35 Rating (161 Votes )
There are 3 Steps involved in it
d The three interfaces are functional interfaces InterfaceB explicitly provides an abstract method d... View full answer
Get step-by-step solutions from verified subject matter experts
