That's because you declared
ze
as accepting a parameter that is an array of
zen1
items:
public static void ze(zen1 s[])
And you are trying to pass a single
zen1
instance to the method:
s[i]=new zen1(test.nextInt(),test.nextLine(),test.nextLine());
ze(s[i]);
Change the method definition to accept a single instance, or call the method outside the loop and pass the whole array:
for(int i=0;i<s.length;i++)
{
s[i]=new zen1(test.nextInt(),test.nextLine(),test.nextLine());
}
ze(s);
You do not want to pass the whole array inside the loop because you do not have all elements containing actual instances until the loop is complete.