public static int count(Collection<Collection<String>> c, String str)
public static void main(String[] args) { Collection> a = new ArrayList >(); String[][] arrays = {{"abc", "def", "ghi"}, {"xyz", "uvw", "abc", "abc"}, {"a", "ab", "abc", "xyz", "abc"}}; for (String[] sArray : arrays){ Collection a1 = new ArrayList (); for (String s: sArray) a1.add(s); a.add(a1); } System.out.println(count(a, "abc")); } }
There is nothing to turn in. You should look at these problems, and try to do the things that you are unsure about.