Friday, April 5, 2019

length of a string

//length of a string                                                                    edited by diya


class p19
{
public static void main(String args[])
{
String s="rittik";
System.out.println("length="+s.length());
for(int i=0;i<s.length();i++)
{
    char ch=s.charAt(i);
    System.out.println(ch);
}

}

}



D:\>java p19
length=6
r
i
t
t
i
k

D:\>

No comments:

Post a Comment