State the output of the following program segment:
String str1 = "great"; String str2 = "minds";
System.out.println(str1.substring(0, 2).concat(str2.substring(1)));
System.out.println(("WH" + (str1.substring(2).toUpperCase())));
Answers
Answered by
0
Answer:
grinds
WHEAT
Explanation:
when two value is given
first one is starting index which is included
second one is end index which is excluded
Similar questions
Hindi,
2 months ago
Social Sciences,
2 months ago
Chemistry,
2 months ago
English,
4 months ago
English,
9 months ago