Hello
both of these methods compile.
Howerver, Are these two methods the same? or does one offer something more?
method 1
public AdminDAO getAdminDAO() {
return new ConnectAdminDAO();
}
method 2 note:getXMLResource() returns: <entry key="adminDAO">model.dao.ConnectAdminDAO</entry>
public synchronized static AdminDAO getAdminUserDAO() throws ClassNotFoundException, InstantiationException, IllegalAccessException, FileNotFoundException, IOException {
Class daoClass = Class.forName(ModelUtils.getXMLResource("adminDAO"));
adminDAO = (ConnectAdminDAO) daoClass.newInstance();
System.out.println("CREATED NEW INSTANCE OF ConnectAdminDAO");
return adminDAO;
}