title: How to Iterate object array [Gson deserialize]?
body: <pre><code>[{bulkNo=91200256, cardType=CDMA_PP, denomination=300, endSerial=6048233, epfId=2254, nextSerialValue=6048226, startSerial=6048225}, {bulkNo=12050021, cardType=CDMA_PP, denomination=200, endSerial=6057151, epfId=2254, nextSerialValue=6057131, startSerial=6057131}, {bulkNo=12100005, cardType=CDMA_PP, denomination=100, endSerial=6003841, epfId=2254, nextSerialValue=6003842, startSerial=6003841}]
  </code></pre>
  
  <p>above shows my Gson array when i debug.need to iterate it and create objects from that</p>
  
  <p>here shows my code</p>
  
  <pre><code>        Gson gson = new Gson();
          List&lt;SerialDetails&gt; serialDetails =new ArrayList&lt;SerialDetails&gt;();  
          serialDetails = gson.fromJson(sendJsonDataList, ArrayList.class);
          for(int i = 0 ; i &lt; serialDetails.size() ; i++){
              SerialDetails item = (SerialDetails) serialDetails.get(i);//ERROR COMES IN HERE
              System.out.println(item);
          }
  </code></pre>
  
  <p>and here shows my error</p>
  
  <pre><code>java.lang.ClassCastException: com.google.gson.internal.LinkedTreeMap cannot be cast to mainService.SerialDetails
      at mainService.Sales.sendJsonDataList(Sales.java:677)
      at mainService.TSR_WEB_SERVICE.sendJsonDataList(TSR_WEB_SERVICE.java:277)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
  </code></pre>
  
  <p>Please help me to sort-out this issue.my bean class correctly created with getters and setters</p>