Program to demonstrates the charAt( )

/* Program to demonstrates the - charAt( ) */

class charAtDemo
{
    public static void main(String args[ ])
    {
        String s = "INDIA";
        char ch;

        System.out.println("String is : "+s);
        ch= s. charAt(2);
        System.out.println("Character at Index 2 (i.e. 3rd position) is : "+ch);
    }
}

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|