i want to know the routine in
JAVA to compute the length of an array
public class chararray
{
public static void main(
String args[])
{
String str = "vijayakumar";
System.out.println(" String ----> "+str);
System.out.println(" Length ----> "+str.length());
char mychar[] = new char[str.length()];
for(int i=0 ; i<str.length();i++)>
{
System.out.println(str.charAt(i));
mychar[i] = str.charAt(i);
}
for(int i=0;i<getLength(mychar);i++)>
I want to store length of the array in an integer
Above program gives error ...
please correct me...
vijay