tag:blogger.com,1999:blog-7258332205026269340.post871090311921278422..comments2024-02-21T01:43:44.367-08:00Comments on Selenium-By-Arun: 98. Using 'charAt( )' method to retrieve the character from string textPriyanka Motoorihttp://www.blogger.com/profile/04643338373711611455noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-7258332205026269340.post-56504410539379467482015-06-26T05:27:33.220-07:002015-06-26T05:27:33.220-07:00@Naveen - I have tried the below program as you me...@Naveen - I have tried the below program as you mentioned and got the exception instead of getting z as you mentioned.<br /><br />public class Test {<br /><br /> public static void main(String[] args) {<br /> <br /> String str = "abcdefghijklmnopqrstuvwxyz";<br /> <br /> System.out.println(str.charAt(26)); <br /> }<br /><br />}<br /><br />Output -> Run time Exception as expected Arun Motoorihttps://www.blogger.com/profile/18156045285817519369noreply@blogger.comtag:blogger.com,1999:blog-7258332205026269340.post-6893435468266921812015-06-26T05:00:24.994-07:002015-06-26T05:00:24.994-07:00Arun I need one clarification
I have used the sa...Arun I need one clarification <br /><br />I have used the same programs as mentioned above and when i tried to <br />print the charAt 26 th place it gave z .... when the index starts at o for A <br />then then the index ends at 25 for z right but i got the output as z for 26 .. <br />Can you let me know the logic hereNaveenhttps://www.blogger.com/profile/14799887314428063573noreply@blogger.com