Java Generics not working

后端 未结 5 687
孤独总比滥情好
孤独总比滥情好 2021-01-29 15:45

Why Generics not working in my machine. Why below code not working in Eclipse without Type casting to the String. I am using Java 1.6

package com.wi         


        
5条回答
  •  花落未央
    2021-01-29 15:48

    This works without cast since Java 1.5.

    package java.util;
    
    public interface List extends Collection {
    
        ....        
    
        E get(int index);
    
        ....
    
    }
    

    Maybe useful: Java Generics

提交回复
热议问题