今天看别人代码, 看到这么一段 public Object selfFactory() {
Class cl = this.getClass();
Constructor cons; try {
cons = cl.getConstructor(null);
} catch(SecurityException e) {
throw new RuntimeException(e);
} catch(NoSuchMethodException e) {
throw new RuntimeException(e);
} try {
return cons.newInstance(null);
} catch(IllegalArgumentException e1) {
throw new RuntimeException(e1);
} catch(InstantiationException e1) {
throw new RuntimeException(e1);
} catch(IllegalAccessException e1) {
throw new RuntimeException(e1);
} catch(InvocationTargetException e1) {
throw new RuntimeException(e1);
}
}请教一下, 这个selffactory() 是属于那一种模式的应用么?作用是什么? 谢谢指教