Example-1
//called
void display(int x[])
{
for(int i=0;i<=2;i++)
System.out.println(x[i]);
}
public static void main(String args[])
{
int a[]= {1,2,3};
Demo ob=new Demo();
//calling
ob.display(a);
Example-2
int a[] = {1,2,3,4,5};
int l = a.length;
In example -1, while calling we have written array a without dimension but during called we have passed it to a parameter x[] with dimension that is an array type.even In example 2 during calculating length of an array we calculate the length without dimension just with . operator along with length property so shouldn't we use here a along with dimension like a[] during calling we have to pass it to an array type variable. as well as during calculating length a[].length