"new" is bound to create one new object "newInstance()" gives you flexibility. you can do straight "new", get an object from a pool, call some other factory, or return singleton. In short, it is one indirection.class X implements IX{...}"new X" promises to the client that you are giving back nothing but an instance of X "IX newInstance()" does not promise that much. you can give back anything that implements IX. this gives you much more flexibility in design.
getInstance每次取到同一个对象
"newInstance()" gives you flexibility. you can do straight "new", get an object from a pool, call some other factory, or return singleton. In short, it is one indirection.class X implements IX{...}"new X" promises to the client that you are giving back nothing but an instance of X
"IX newInstance()" does not promise that much. you can give back anything that implements IX. this gives you much more flexibility in design.