Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started