In C I can do the following within methods:
How would I create a static variable within a Java method? I don't want to have to create a class variable and I can't seem to get a static initializer block to work nor am I able to declare a static variable within a method.Code:void methodA(void){ static int varA = 0; //perform some check on varA and change if necessary }
Thank you.


Reply With Quote


Bookmarks