Primitive wrapper class in Java: Difference between revisions

Content deleted Content added
Line 39:
Class clazz = Class.forName("Foo");
Object foo = clazz.newInstance();
Method method = clazz.getMethod("doSomething", argsInteger.Type);
Class[] args = new Class[1];
args[0] = Integer.Type;
Method method = clazz.getMethod("doSomething", args);
method.invoke(foo, 1);
</source>