In this section, you will get the detailed explanation about the charAt() method of String class. We are going for using charAt() method. You can see how to use the method by syntax. There is a section provided for understanding the usage of the method practically.
Description of program:
Here, you will understand about the procedure of the charAt() method through the following java program. This program reads a string as input through the keyboard. And first this shows the length of the string then find the character at the 4th (mentioned as a parameter of the method) position of the string that is retrieved by using charAt() method. This method takes a parameter that is the position of the string. The charAt() method returns a character value for the character at the given position of the string.
Here is the code of this program:
Enter the String
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: June 5, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles