import java.util.*; import java.io.*; import java.util.ArrayList; import java.util.Collection; public class CollToArr { public static void main(String args[]) { String weekdays[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday","Friday", "Saturday"}; Collection days = new ArrayList(); for (int i = 0, n = weekdays.length; i < n; i++) { days.add(weekdays[i]); } String s[] = (String[])days.toArray(new String[0]); for (int i = 0, n = s.length; i < n; i++) { System.out.println(s[i]); } } }