FileDocCategorySizeDatePackage
SpecificMethodInfoDemo.javaAPI DocExample1610Sun Dec 14 22:47:32 GMT 2003oreilly.hcj.reflection

SpecificMethodInfoDemo

public class SpecificMethodInfoDemo extends Object
Demonstrates how to get specific method information.
author
Robert Simmons jr. (kraythe)
version
$Revision: 1.3 $

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)
Demo method.

param
args Command line arguments.
throws
RuntimeException If there is a reflection problem.

		final Method byteValueMeth;
		final Method waitMeth;
		final Method waitDetailMeth;

		try {
			byteValueMeth = Number.class.getMethod("byteValue", null);
			waitMeth = Number.class.getMethod("wait", new Class[] {  });
			waitDetailMeth =
				Number.class.getMethod("wait", new Class[] { long.class, int.class });
		} catch (final NoSuchMethodException ex) {
			throw new RuntimeException(ex);
		}

		System.out.println("byteValueMeth = " + byteValueMeth.toString());
		System.out.println("waitMeth = " + waitMeth.toString());
		System.out.println("waitDetailMeth = " + waitDetailMeth.toString());