I am getting following error while trying to execute following code snippets. Please let me know what are the possible reasons of getting this error.
List list = .... ;
for(Object obj:list)
{
Object[] myObj = (Object[])obj;
Long lg = ...;
if(myObj[1]!=null){
lg = ((BigDecimal)myObj[1]).longValue();
}
java.lang.ClassCastException
at java.lang.Class.cast(Class.java:...)
lg = ((BigDecimal)myObj[1]).longValue();