Hi
Sorry for the newbie question, I'm used to C# so my Java framework knowledge is not so good.
I have a couple of arrays:
int[] numbers = new int[10];
String[] names = new String[10];
//populate the arrays
Now I want to make a generic function which will print out the values in these arrays, something like the following (this should work in C#)
private void PrintAll(IEnumerable items)
{
foreach(object item in items)
Console.WriteLine(item.ToString());
}
All I would have to do now is to
PrintAll(names);
PrintAll(numbers);
How can I do this in Java? What is the inheritance tree for the array in Java?
Many thanks
Bones