Program to calculate length of string

/* Program to calculate length of string */

class lengthDemo
{
    public static void main(String args[ ])
    {       
        String str = "INDIA";        // use string literal
        System.out.println(" String is : "+str);
        System.out.println(" Length of String is : "+str.length());
    }
}

0 comments:

Post a Comment

 
 
 
 


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