Top Posters
Since Sunday
z
4
n
4
t
4
k
3
x
3
r
3
m
3
j
3
c
3
l
3
e
3
s
2
New Topic  
rsbains rsbains
wrote...
Posts: 475
4 years ago
What is the output of the following code?

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


▸ s1 and s2 have different contents

▸ s1 and s2 have the same contents
Textbook 
Introduction to Java Programming, Comprehensive Version

Introduction to Java Programming, Comprehensive Version


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

rsbains Author
wrote...

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

Yesterday
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
  1120 People Browsing
Related Images
  
 332
  
 300
  
 122
Your Opinion
Which 'study break' activity do you find most distracting?
Votes: 824