The type Collection is not generic; it cannot be parameterized with arguments <? extends E>

后端 未结 13 491
清酒与你
清酒与你 2020-12-05 03:02

I have a strange problem with Eclipse Galileo.
I set Java 1.6 as my JRE. On this line of code

List templates = new ArrayList ();

I see

13条回答
  •  清歌不尽
    2020-12-05 03:51

    Did you name your class list? i.e:

    import java.util.*;
    
    public class List {   // can't do this, name this something else.
    
        public static void main(String[] args) {
            List l = new ArrayList();
    
        }
    
    }
    

提交回复
热议问题