FileDocCategorySizeDatePackage
ClassKeyword.javaAPI DocExample782Sat Nov 25 12:55:24 GMT 2000None

ClassKeyword

public class ClassKeyword extends Object
Show the Class keyword and getClass() method in action.
author
Ian F. Darwin, ian@darwinsys.com
version
$Id: ClassKeyword.java,v 1.2 2000/11/25 17:55:24 ian Exp $

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

		//+
		System.out.println("Trying the ClassName.class keyword:");
		System.out.println("Object class: " + Object.class);
		System.out.println("String class: " + String.class);
		System.out.println("Calendar class: " + Calendar.class);
		System.out.println("Current class: " + ClassKeyword.class);
		System.out.println();

		System.out.println("Trying the instance.getClass() method:");
		System.out.println("Robin the Fearless".getClass());
		System.out.println(Calendar.getInstance().getClass());
		//-