Javascript .apply() method equivalent in Java?
问题 I want to create a class in Java from a classname and an variable number of arguments (i.e. an Object[] args with variable length). Is there any way to achieve that? Basically, the method would look like this in Javascript function createClass(classname, args) { protoObject = Object.create(window[classname].prototype); return window[classname].apply(protoObject,args) || protoObject; } // I want to be able to do this: var resultClass = createClass("someClass", someArrayOfArgs); A simpler