开发者

parameterized types and raw types for different classes

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜