String Length
by , 04-26-2012 at 06:26 PM (202 Views)
An object’s information is seeked by certain methods and those methods are named as accessor methods. Among them, one that could be used along with strings is known as length() method that would be returning no. of characters present in string object.
Result would be:Java Code:public class StringDemo{ public static void main(String args[]){ String palindrome = "Dot saw I was Tod"; int len = palindrome.length(); System.out.println( "String Length is : " + len ); } }
String Length is : 17









Email Blog Entry
PDF to TIFF Conversion & Control...
05-24-2013, 11:39 AM in Java Software