Possible Duplicate:
Create new class from a Variable in Java
i had a scenario like this,
String className;
if(someCondition){
className="A";
}
else{
className='B'
}
Now i want to do this dynamically
className obj=(className) dbObj;//i am typcasting the db casting to particular class
Note:Here A and B classes having same setters and getters but belongs to two different tables in db