KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
This could well be a stupid question, but I'm new to Java, so... I've currently got some code where currently this is being used clazz.asSubclass(asSubclassOfClass).getConstructor().newInstance() I need to pass some arguments to the contructort so I want to change it to: clazz.asSubclass(asSubclassOfClass).getConstructor(params).newInstance(args) What I don't understand is what I need to pass in as params and what I need to pass in as args . Let's say I wanted to pass in a String "howdy" and some object of type XYZ called XyzObj in. How would I specify that? WHat would I pass as params and what would I pass as args?
Tags (comma-separated)
Save Edits
Cancel