Posted by : Unknown Thursday, 11 June 2015

class google
public static void main(String... df) 
String s="GOOGLE";
System.out.println("The length of string is : ");
System.out.println("GOOGLE".length());
System.out.println();
String s1=s.substring(0,1);
System.out.println(s1);
String s2=s.substring(0,2);
System.out.println(s2);
String s3=s.substring(0,3);
System.out.println(s3);
String s4=s.substring(0,4);
System.out.println(s4);
String s5=s.substring(0,5);
System.out.println(s5);
String s6=s.substring(0,6);
System.out.println(s6);
}
}

Output:















Leave a Reply

Subscribe to Posts | Subscribe to Comments

Welcome to My Blog

Translate

Popular Post

Total Pageviews

Blog Archive

- Copyright © Learning Java Program - Powered by Blogger -