开发者

parameterized types and raw types for different classes

开发者 https://www.devze.com 2023-04-02 14:06 出处:网络
Using raw type warning occured, how to use par开发者_开发问答ameterized type for List apa=(List)class1.method1(xx);

Using raw type warning occured, how to use par开发者_开发问答ameterized type for

List apa=(List)class1.method1(xx);

All the values present in the list are of String type.


List<String> apa = class1.method1(xx);

and specify return type of List<String> for method1 in the class definition.


If all present values are String means use like this,

List<String> apa  = (List<String>)class1.method1(xx); 
0

精彩评论

暂无评论...
验证码 换一张
取 消