Tutorials Point


  Java Basics
  Java Object Oriented
  Java Advanced
  Java Useful References
  Java Useful Resources
  Selected Reading

© 2011 TutorialsPoint.COM


  Home     References     Discussion Forums     About TP  

Java - String charAt() Method


previous next AddThis Social Bookmark Button


Description:

This method returns the character located at the String's specified index. The string indexes start from zero.

Syntax:

Here is the syntax of this method:

public char charAt(int index)

Parameters:

Here is the detail of parameters:

  • index : Index of the character to be returned.

Return Value :

  • Returns a char at the specified index.

Example:

public class Test{
   public static void main(String args[]){
      String s = "Strings are immutable";
      char result = s.charAt(8);
      System.out.println(result);
   }
}

This produces following result:

a


previous next Printer Friendly



  

Advertisement

Online Image Processing

Indian Baby Names