Is any Java interface implicitly implements java.lang.Object?
This question arose when I did something like this:
public static String[] sizeSort(String[] sa) { Comparator<String> c = new Comparator<String>() { public int compare(String a, String b) { if (a.length() > b.length()) return 1; else if (a.length() < b.length()) return -1; else return 0; } };
It worked fine, although I did not implement the equals method of this interface. Your answers make this clear. But does anyone know if the above is an anonymous local inner class or a named local inner class?
source share