DOWNLOAD

Get our toolbar!

Saturday, 30 April 2011

// write a program which counts the length of the string.

CODE



import java.lang.*;

import java.io.*;
public class StringLength{
public static void main(String[] args) throws IOException{
System.out.println("String lenght example!");
BufferedReader bf = new BufferedReader(new
InputStreamReader(System.in));
System.out.println("Please enter string:");
String str = bf.readLine();
int len = str.length();
System.out.println("String lenght : " + len);
}
}


OUTPUT DISPLAY



0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More