In .NET, both array and list have Enumerable as ancestor, so a method that accept Enumerable as an argument can receive both array and list as its argument. I wonder if ther
Array and List in Java do not share a common ancestor other than java.lang.Object.
Both can be accessed using the foreach loop, like so:
String [] array = new String [] { "foo", "bar", "baz", };
List list = Arrays.asList( "x", "y", "z");
for (String s : array)
System.out.println(s);
for (String s : list)
System.out.println(s);