Resolving ClassCastException in this code
<p>I have this method getData as shown .
It is expecting an array of bag Objects as shown 
please see the code below :</p>

<pre><code>public static String getData(Bag[] bag)
 {

 }

public class Bag
{
 public char side;
}
</code></pre>

<p>But , when i tried i am getting ClassCastException .
<strong>I have done this way :</strong></p>

<pre><code>Object bagArray[] = new Object[1];
Bag  bagData = new Bag();
bagData.side = 'S';
bagArray[0]=bagData;
String bagData = ApplicationUtil.getData(Bag[]) bagArray);
</code></pre>

<p>Please let me , how to resolve this error ??</p>
