class AnonymousArray
{
public static void main(String args[])
{
System.out.println(“Length of array is “ + findLength(new int[]{1,2,3}));
}
public static int findLength(int[] array)
{
return array.length;
}
}
Output:
Length of array is 3
0 comments:
Post a Comment