2:34 am - Tuesday April 23, 2019

Retrieve the character at given position char charAt( int index)

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

                                                  This method returns the character value at the specified index.The string indexes value is start from zero.

Example Program


  public class Model1 
 
 {

  public static void main(String args[])

   {

    String s = "hello";

    char k = s.charAt(1);

    System.out.println(k);

   }

  }

Output

     e

 

Filed in: Java Examples

Comments are closed.