FileDocCategorySizeDatePackage
ShowToString.javaAPI DocExample895Sat Nov 25 12:55:46 GMT 2000None

ShowToString

public class ShowToString extends Object
ShowToString -- demo program to show default toString methods. Some classes provide a toString() method, while others inherit the default toString() from Object. In all cases, you can print an object by calling its toString(), which is very useful in debugging!

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


		System.out.println("An Object\t" + new Object());
		System.out.println("A Date  \t" + new Date());
		System.out.println("A GregorianCalendar\t" + new GregorianCalendar());
		System.out.println("An Exception\t" + new Exception("Hi!"));
		Button b = new Button("Push ME!");	// An AWT pushbutton
		b.setBounds(40, 50, 120, 60);	// explained in the AWT chapter!
		System.out.println("A Button\t" + b);
		System.out.println("A ShowToString object!\t" + new ShowToString());