FileDocCategorySizeDatePackage
NoLocalStatics.javaAPI DocExample321Sun Feb 22 20:32:36 GMT 2004None

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()

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