Question: Given the following classes and their objects: interface C 1 { } class C 2 implements C 1 { } class C 3 implements C

Given the following classes and their objects:
interface C1{}
class C2 implements C1{}
class C3 implements C1{}
Analyze the following statement:
c2=(C2)((C1) c3);
Group of answer choices
You will get a runtime error because you cannot cast objects from sibling subtypes.
c3 is cast into c2 successfully.
You will get a runtime error because the Java runtime system cannot perform multiple casting in nested form.
The statement is correct.

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!