codice:
return (DAOFactory) Class.forName(whichFactory).newInstance();
No non è vero che crea un ogetto DAOFactory ma bensi un oggetto di tipo "wichFactory" e poi effettua un casting esplicto a DAOFactory, si deduce che la "wichFactory" deve essere un sottoclasse "concreta" di DaoFactory.