Question: Q 3 ( 4 marks ) : Suppose the s 1 and s 2 are two strings given as follows: String s 1 = Welcome

Q3(4 marks): Suppose the s1 and s2 are two strings given as follows:
String s1= "Welcome to Java";
String s2= new String("Welcome to Java");
What are the results of the following expressions?
a.s1==s2
b. s1.equals(s2)
c. s1.replace("o", "abc")
d. s2.replaceFirst("e","xyz")
Q 3 ( 4 marks ) : Suppose the s 1 and s 2 are two

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!