In C, I can create a static variable in a function. The space for this variable is not allocated along with the functional variables that are allocated when the program starts. (Don't mess with me too hard, I've been programming in Java for too long :)
void myFunc(){
static SomeStruct someStruct;
someStruct.state=INITIALIZED;
goDoSomethingInteresting(MY_COMMAND,&someStruct);
}
In Java, if I want to do something like this, I create a class variable and then use it.
Class TheClass {
SomeStruct someStruct = new SomeStruct();
void myFunc(){
someStruct.setState(INITIALIZED);
goDoSomethingInteresting(MY_COMMAND,someStruct);
}
}
, - ? someStruct myFunc, myFunc - , someStruct, , . , Javadoc , , , .
someStruct , someStruct, myFunc .