Top Posters
Since Sunday
6
y
2
m
2
m
2
u
2
m
2
B
2
M
2
e
2
k
2
N
2
y
2
New Topic  
uni67 uni67
wrote...
Posts: 475
4 years ago
Given the following classes and their objects:

class C1 {};
class C2 extends C1 {};
class C3 extends C1 {};

C2 c2 = new C2();
C3 c3 = new C3();

Analyze the following statement:

c2 = (C2)((C1)c3);


▸ c3 is cast into c2 successfully.

▸ You will get a runtime error because the Java runtime system cannot perform multiple casting in nested form.

▸ You will get a runtime error because you cannot cast objects from sibling classes.

▸ The statement is correct.
Textbook 
Introduction to Java Programming, Comprehensive Version

Introduction to Java Programming, Comprehensive Version


Edition: 10th
Author:
Read 54 times
1 Reply
Replies
Answer verified by a subject expert
crdsacrdsa
wrote...
Posts: 370
4 years ago
Sign in or Sign up in seconds to unlock everything for free
More solutions for this book are available here
1

Related Topics

uni67 Author
wrote...

4 years ago
Correct Slight Smile TY
wrote...

Yesterday
Brilliant
wrote...

2 hours ago
I appreciate what you did here, answered it right Smiling Face with Open Mouth
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  501 People Browsing
Related Images
  
 1253
  
 537
  
 302