Question: Suppose C is a class that implements the interfaces I and J, and i is declared as I i = new C(); Which of the

Suppose C is a class that implements the interfaces I and J, and i is declared as I i = new C();
Which of the following statements will throw an exception?
a. C c = (C) i;
b. J j = (J) i;
c. i = (I) null;

Step by Step Solution

3.45 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here i is the object of C of type I In the 3 options abc w... View full answer

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

Document Format (2 attachments)

PDF file Icon

2106_61d6ac346753c_873119.pdf

180 KBs PDF File

Word file Icon

2106_61d6ac346753c_873119.docx

120 KBs Word File

Students Have Also Explored These Related Java Concepts Late Objects Questions!