✏️ Explanatory Question
String s1 = "good"; String s2 = "world matters"; String str1 = s2.substring(5).replace('t', 'n'); String str2 = s1.concat(str1);
Value stored in str1 is " manners" and str2 is "good manners". (Note that str1 begins with a space.)
s2.substring(5) gives a substring from index 5 till the end of the string which is " matters". The replace method replaces all 't' in " matters" with 'n' giving " manners". s1.concat(str1) joins together "good" and " manners" so "good manners" is stored in str2.