java - Cannot use static List within Comparator -


Why me to fully qualify java.lang.String in the list of stable areas < Pre> 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; }}

The error "can not create a static reference for non-static type string"

You have defined a normal type parameter string which is the same name as the square, therefore string refers to your parameter, while < Code> Java.lang.String still works.

Remove it from your class, but keep it in the apply section.

  Public static class MyComparator Comparator & lt; String & gt; Applies. {   

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -