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

SpecificMethodInfoDemo.java

/*
 *     file: SpecificMethodInfoDemo.java
 *  package: oreilly.hcj.reflection
 *
 * This software is granted under the terms of the Common Public License,
 * CPL, which may be found at the following URL:
 * http://www-124.ibm.com/developerworks/oss/CPLv1.0.htm
 *
 * Copyright(c) 2003-2005 by the authors indicated in the @author tags.
 * All Rights are Reserved by the various authors.
 *
########## DO NOT EDIT ABOVE THIS LINE ########## */

package oreilly.hcj.reflection;

import java.lang.reflect.Method;

/**  
 * Demonstrates how to get specific method information.
 *
 * @author <a href=mailto:kraythe@arcor.de>Robert Simmons jr. (kraythe)</a>
 * @version $Revision: 1.3 $
 */
public class SpecificMethodInfoDemo {
	/** 
	 * Demo method.
	 *
	 * @param args Command line arguments.
	 *
	 * @throws RuntimeException If there is a reflection problem.
	 */
	public static void main(final String[] args) {
		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());
	}
}

/* ########## End of File ########## */