Here is the snap shot of the working solution to the said question..
try{
System.out.println( class name is +class_name);
Class cls Class.forName(class_name);
Constructor[] ctorlist cls.getConstructors();
/*
*temporary remove the sysout statement
*
*
*/
/** to go to the list box
*
*/
for(int i 0;i<ctorlist.length;i++)System.
out.println(ctorlist[i]+ i +i);partypes ctorlist[inx].getParameterTypes();Constructor ctor cls.getConstructor(
partypes);argcnt partypes.length;System.
out.println( argcnt +argcnt);arglist new Object[argcnt];/**call to verify the argument
*/
boolean temp comparevalidate();if(objectlist.size()>0)System.
out.println( object list is :: + objectlist.toString());for(int i 0;i<arglist.length;i++)System.
out.println( arglist +arglist[i].toString());if(temp true){System.
out.println( created new object );Object retobj ctor.newInstance(
arglist);objectlist.add(retobj);if(objectlist.size()>0)System.
out.println( object list is new:: + objectlist.toString());/*elseif((argcnt 0) && (paramValues.size() 0))
{
Object retobjnew cls.newInstance();
objectlist.add(retobjnew);
System.out.println( inside default constructor );
}*/
}
}
catch(Exception ex){ex.printStackTrace();}