Question: hich code snippet will output Yes ! when two strings s 1 and s 2 are equal? Question 1 Select one: a . if (

hich code snippet will output Yes! when two strings s1 and s2 are equal?
Question 1Select one:
a.
if (s1.compareTo(s2)==1)
{
System.out.println("Yes!");
}
b.
if (s1= s2)
{
System.out.println("Yes!");
}
c.
if (s1.equals(s2))
{
System.out.println("Yes!");
}
d.
if (s1== s2)
{
System.out.println("Yes!");
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!