Top Posters
Since Sunday
G
4
K
3
o
3
3
m
2
c
2
r
2
p
2
s
2
s
2
b
2
c
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 44 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
Thanks
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
  1126 People Browsing
Related Images
  
 330
  
 643
  
 983
Your Opinion
Which of the following is the best resource to supplement your studies:
Votes: 300