Back To Java String Class Index
//program to demonstrate length method of String class public class stringlength { public static void main(String[] args) { String ob=new String("abcdef"); int len; len=ob.length(); System.out.println("length of string is " + len); } }