Top Posters
Since Sunday
c
5
j
5
a
5
L
5
f
5
j
5
D
4
k
4
y
4
t
4
h
4
l
4
New Topic  
fattykay92 fattykay92
wrote...
Posts: 467
4 years ago
Analyze the following code:

public class Test {
public static void main(String[] args) {
String s = new String("Welcome to Java");
Object o = s;
String d = (String)o;
}
}


▸ When casting o to s in String d = (String)o, the contents of o is changed.

▸ s, o, and d reference the same String object.

▸ When casting o to s in String d = (String)o, a new object is created.

▸ When assigning s to o in Object o = s, a new object is created.
Textbook 
Introduction to Java Programming, Comprehensive Version

Introduction to Java Programming, Comprehensive Version


Edition: 10th
Author:
Read 55 times
1 Reply
Replies
Answer verified by a subject expert
IsackIsack
wrote...
Posts: 394
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

fattykay92 Author
wrote...

4 years ago
this is exactly what I needed
wrote...

Yesterday
I appreciate what you did here, answered it right Smiling Face with Open Mouth
wrote...

2 hours ago
Thank you, thank you, thank you!
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  754 People Browsing
Related Images
  
 45
  
 1024
  
 848
Your Opinion
Which industry do you think artificial intelligence (AI) will impact the most?
Votes: 379