Output of given segment: String st = “PROGRAM”; System.out.println(st.indexOf(st.charAt(4))); | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Output of given segment: String st = “PROGRAM”; System.out.println(st.indexOf(st.charAt(4)));

14th Feb 2020, 2:51 PM
Hasshya Krishnamoorthy
4 Antworten
14th Feb 2020, 3:07 PM
Prokopios Poulimenos
Prokopios Poulimenos - avatar
0
Just run it in the code playground and see for yourself. It's a way better and faster way to get the answer to your question.
14th Feb 2020, 3:01 PM
XXX
XXX - avatar
0
Yes. That's because charAt(4) is 'R' and the first index of 'R' in 'PROGRAM' is 1. 0 1 2 3 4 5 6 P R O G R A M
14th Feb 2020, 3:09 PM
XXX
XXX - avatar
0
Answer I need
20th Mar 2024, 4:00 PM
Sravani