Top Posters
Since Sunday
G
4
o
4
4
K
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 45 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
Just got PERFECT on my quiz
wrote...

Yesterday
Thank you, thank you, thank you!
wrote...

2 hours ago
Thanks
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  1199 People Browsing
Related Images
  
 318
  
 305
  
 402
Your Opinion
Which is the best fuel for late night cramming?
Votes: 146