FileDocCategorySizeDatePackage
Simple.javaAPI DocExample655Sat Oct 26 10:34:28 BST 2002None

Simple

public class Simple extends Object
Show a couple of things you can do with a Class object.
author
Ian F. Darwin, ian darwinsys.com
version
$Id: Simple.java,v 1.1 2002/10/26 14:34:28 ian Exp $

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] argv)

		Class c = Class.forName("java.util.Date");

		Date d = (Date)c.newInstance();
		System.out.println("Today is " + d);

		System.out.println("d is of class " + c.getName());

		Method[] methods = c.getMethods();
		// Just print the first few to avoid filling the screen.
		for (int i=0; i<10; i++)
			System.out.println(methods[i].toString());