Pages

Tuesday, July 3, 2012

How to find length of a number

Write a program that calculates the length(i.e. number of characters) in the input string.

class length
{
public static void main(String args[])
{
String val=args[0];
System.out.println("The length of "+val+" is : "+val.length());
}
}

No comments:

Post a Comment