Using 'charAt( )' method to retrieve the character from string text

You can use charAt( ) method to retrieve the character at a specified index with in a string.

Example:- 

String myString1 = "abcdefghijklmnopqrstuvwxyz";

System.out.println(myString1.charAt(0));
System.out.println(myString1.charAt(1));
System.out.println(myString1.charAt(2));

Lets implement this on Eclipse IDE:

1. Create 'CharAtDemo' class under any project as shown below:



2. Save and Run the 'CharAtDemo' class
3. Observe that the output is displayed in the console as shown below: