State the output of the following program segment.
String s1= ”TRANSITION” ;
String s2= ”MOCK TEST”;
(i) System.out.println(s1.substring(0,3).concat(s2.substring(5));
(ii) System.out.println((int)s2.charAt(6));
(iii) System.out.println(s1.replace(„T‟,‟F‟));
(iv) System.out.println(s1.charAt(s1.indexOf(„R‟)+s2.indexOf(„T‟)));
Answers
Answered by
2
(i) TRATEST
(ii) 69
(iii) FRANSIFION
(iv) T
Similar questions