Question: String s1 = Welcome to Java; String s2=s1 ; String s3 = new String(Welcome to Java); String s4 = Welcome to Java; What are the

String s1 = "Welcome to Java";\ String

s2=s1

;\ String s3 = new String("Welcome to Java");\ String s4 = "Welcome to Java";\ What are the results of the following expressions?\ a.

,s1=s2

\ b.

sl=s3

\ c.

,s1=s4

\ d. s1.equals(s3)\ e. s1.equals(s4)\ f. "Welcome to Java".replace("Java", "HTML")\ g. s1.replace('o', 'T')\ h. sl.replaceAll("o", "T")\ i. s1.replaceFirst("o", "T")\ j. s1.toCharArray()

 String s1 = "Welcome to Java";\ String s2=s1;\ String s3 =

String s1 = "Welcome to Java"; String s2=s1; String s3 = new String("Welcome to Java"); String s4 = "Welcome to Java"; What are the results of the following expressions? a. s1=s2 b. s1=s3 c. s1=s4 d. s1.equals(s3) e. sl.equals(s4) f. "Welcome to Java",replace("Java", "HTML") g. s1.replace('o', 'T') h. s1.replaceAll("o", "T") i. s1.replaceFirst("o", "T") j. s1.toCharArray()

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 Databases Questions!