Top Posters
Since Sunday
L
4
d
4
3
k
3
k
3
j
3
k
3
b
3
f
3
b
3
d
3
h
3
New Topic  
Yessi15 Yessi15
wrote...
Posts: 491
4 years ago
What is the output of the following code?

public class Test {
public static void main(String[] args) {
String s1 = "Welcome to Java!";
String s2 = "Welcome to Java!";
if (s1 == s2)
System.out.println("s1 and s2 reference to the same String object");
else
System.out.println("s1 and s2 reference to different String objects");
}
}


▸ s1 and s2 reference to the same String object

▸ s1 and s2 reference to different String objects
Textbook 
Introduction to Java Programming, Comprehensive Version

Introduction to Java Programming, Comprehensive Version


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

Yessi15 Author
wrote...

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

Yesterday
Smart ... Thanks!
wrote...

2 hours ago
Correct Slight Smile TY
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  1036 People Browsing
Related Images
  
 2566
  
 372
  
 4908
Your Opinion
Which industry do you think artificial intelligence (AI) will impact the most?
Votes: 405