udhaya
udhaya

Reputation: 149

parameterized types and raw types for different classes

Using raw type warning occured, how to use parameterized type for

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

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

Upvotes: 0

Views: 66

Answers (2)

bharath
bharath

Reputation: 14453

If all present values are String means use like this,

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

Upvotes: 0

hvgotcodes
hvgotcodes

Reputation: 120198

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

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

Upvotes: 2

Related Questions