FileDocCategorySizeDatePackage
VariousMethodDemos.javaAPI DocExample1353Sun Dec 14 22:47:32 GMT 2003oreilly.hcj.reflection

VariousMethodDemos

public class VariousMethodDemos extends Object
Demonstration of various method invocation issues.
author
Robert Simmons jr. (kraythe)
version
$Revision$

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)
Run the demo.

param
args Command line arguments (ignored).

		try {
			final Class[] ARG_TYPES = new Class[] { String.class };
			Object result = null;

			Method meth = Integer.class.getMethod("parseInt", ARG_TYPES);

			result = meth.invoke(null, new Object[] { new String("44") });
			System.out.println(result);

			result = meth.invoke(null, new Object[] { new String("Jonny") });
			System.out.println(result);
		} catch (final Exception ex) {
			ex.printStackTrace();
		}