java - Cannot use static List within Comparator -
Why me to fully qualify java.lang.String in the list of stable areas < Pre> The error "can not create a static reference for non-static type string" You have defined a normal type parameter Remove it from your class, but keep it in the public stable class MyComparator & lt; String & gt; Applies Comparator & lt; String & gt; {Public stable list sort order; Public static list & lt; Integer & gt; SortOrder2; Public static list & lt; Java.lang.String & gt; SortOrder3; // Works! Public static list & lt; String & gt; SortOrder4; // & lt; - Compiler Error: Comparison of Override Public Int = Only In This Line (String S1, String S2) {// TODO return -1; }}
string which is the same name as the square, therefore
string refers to your parameter, while < Code> Java.lang.String still works.
apply section.
Public static class MyComparator Comparator & lt; String & gt; Applies. {
Comments
Post a Comment