I am creating the Leg Objects this way
List<Leg> legs = new ArrayList<Leg>(legdata.length);
I need to pass this legs to an method with the below signature as shown :
public static String getStrategy(Leg[] leg)
when i did the below way i am getting an error .
String resultData = CMPUtil.getStrategy(legs.toArray());
Also tried this way
Leg les[] = (Leg)legs.toArray(); ( It says cannot cast from Object to Leg)
could anybody please let me know , how to resolve this ??