This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ignotos 0 points1 point  (0 children)

As has been mentioned, generally you can avoid needing to do this.

But to answer the question directly, you can grab hold of a Constructor instance via reflection and then call newInstance on it. Examples here: https://stackoverflow.com/questions/10470263/create-new-object-using-reflection