I have this method getData as shown . It is expecting an array of bag Objects as shown please see the code below :
public static String getData(Bag[] bag)
 {
 }
public class Bag
{
 public char side;
}
But , when i tried i am getting ClassCastException . I have done this way :
Object bagArray[] = new Object[1];
Bag  bagData = new Bag();
bagData.side = 'S';
bagArray[0]=bagData;
String bagData = ApplicationUtil.getData(Bag[]) bagArray);
Please let me , how to resolve this error ??
 
     
     
     
     
    