FileDocCategorySizeDatePackage
InitializerDemo.javaAPI DocExample2586Sun Dec 14 22:47:38 GMT 2003oreilly.hcj.review

InitializerDemo

public class InitializerDemo extends Object
Demonstrates various initializers.
author
Robert Simmons jr. (kraythe)
version
$Revision: 1.4 $

Fields Summary
public static final String
NAME
Simple static initialization.
public static final String
ARCH
Initialized static on one line.
public static final String
USER_HOME
Static method based initialization.
public String
description
Simple instance member initialization.
public long
timestamp
Method call instance member initialization.
private String
xmlClasspath
Complex instance member initialization.
Constructors Summary
public InitializerDemo()
Creates a new instance of Initalizers

	
		final StringBuffer buf = new StringBuffer(500);
		final String classPath = System.getProperty("java.class.path");
		StringTokenizer tok =
			new StringTokenizer(classPath, System.getProperty("path.separator"));
		buf.append("<classpath>\n");
		while (tok.hasMoreTokens()) {
			buf.append("  <pathelement location=\"");
			buf.append(tok.nextToken());
			buf.append("\"/>\n");
		}
		buf.append("</classpath>");
		xmlClasspath = buf.toString();
	
	
Methods Summary
public static final voidmain(java.lang.String[] args)
Main method of the demonstration.

param
args Command line arguments (ignored).

		InitializerDemo demo = new InitializerDemo();
		System.out.println("------Dumping Contents-----------");
		System.out.println("---------------------------------");
		System.out.println(InitializerDemo.NAME);
		System.out.println(InitializerDemo.ARCH);
		System.out.println(InitializerDemo.USER_HOME);
		System.out.println(demo.description);
		System.out.println(demo.xmlClasspath);
		System.out.println("---------------------------------");