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();
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:
Related Posts :
- Back to Home »
- Simple Program »
- Print the given string in Half Pyramid format