1.new can call a constructor with parameters, newinstance not.
2.new is a Java keyword used to construct an instance of a class. Newinstance is a method of Class, but the same is true of the two notation.
3.newInstance: Weak type. Low efficiency. Only parameterless constructs can be called. NEW: Strongly typed. relatively efficient. Can invoke any public construct.
4.new is the keyword, used to produce objects, can call the class to expose any construction method and newinstance is reflected when used, can only call the parameterless construction method, if you want to call the constructor method with parameters, you can use the constructor newinstance (Object... initargs)
method.
Note: In the open source Chinese community to see a more vivid metaphor:
New is to cook, cook and eat for yourself. Newinstance is eating outside to make you eat.
Self-made can guarantee safety, and can have multiple flavors, what sauce, put how much to set. The new object does not have an exception because the class cannot be found, and you can call more than one constructor and go to the new object in your own taste to do something that suits your tastes.
Eat outside, you may order the dishes that are not in the shop, or the taste is not right, you want to eat tomato sauce, but others only peanut butter. And you don't know if the dishes are clean. Newinstance is the same, it is possible that you want the object he does not exist, or the parameters are not correct.
What is the difference between the new keyword and the newinstance () method in Java?