Hi maheshwari_siddharth,
still you provide no information on your class structure neither do you post the stack trace of your exception - how is someone supposed to help if you do not provide the necessary information???
So another guess from the following code line:
Code:
(CompanyForm)DirectorList.get(i).ischecked()==true //now we are checking which two lines are selected
It looks like the elements of
DirectorList need to be instances of the
CompanyForm class to simply be able to cast. If that is case you still might have some syntax error since your cast does not seem to do what you intent. Try enclosing
(CompanyForm)DirectorList.get(i) in round brackets:
Code:
((CompanyForm) DirectorList.get(i)).ischecked()==true //now we are checking which two lines are selected
This will
NOT get rid of your CCE - I do not believe that the elements in your
DirectorList are actually of type
CompanyForm. That's not very likely. In Java you can only cast to types that are above the actual in the same class hierarchy.
... and still this is a Java question, no Hibernate question. You ended up in the wrong forum.
CU
Froestel