Java Generics not working

后端 未结 5 691
孤独总比滥情好
孤独总比滥情好 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:55

    This statement can't give any error if you are using java 1.5 or greater. But if you are using some older version than

    List list = new ArrayList();
    

    will give error. First you will have to solve this issue than type cast will come.

提交回复
热议问题