FileDocCategorySizeDatePackage
NoLocalStatics.javaAPI DocExample348Sat Nov 25 12:55:44 GMT 2000None

NoLocalStatics

public class NoLocalStatics extends Object
Show that you can't have static variables in a method, unlike C/C++

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

		NoLocalStatics t = new NoLocalStatics();
		t.process();
	
voidprocess()

				// EXPECT COMPILE ERROR
		static int a = 42;			// EXPECT COMPILE ERROR
		System.out.println("Process: " + a);