if i have a type stored in a variable
(def ta java.util.Vector)
how can I initialise a new Vector type with the symbol stored in a?
eg.
(initialize ta params) => #Vector <params>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well your
tais an instance of java.lang.Class, so you can just use thenewInstancemethod directly:If you want to use parameters to the constructor, you can go via the
getConstructormethod with something like:Although this can be a bit more fiddly as you need to exactly match the parameter types in order to obtain the right constructor….