I have this code to print all elements out in an array

public void printChildren(ArrayList<Person> child){

for (int i = 0 ; i < child.size(); i++)
System.out.println( child.get(i).getName() + " " + child.get(i).getAge());



}
}

But I cant really make it work in the main.... trying to call it but I only get error.. so how can I call it or print it from the main

thanks