posted 21 years ago
hi,
can anyone answer these qstns?
1. are the variables declared in the static initializer implicitly static?
2. why is it giving me the compiler error when i mention static before the variable in static initializer.
3. static
{
// static int x= 5,y=5; //gives compiler error
int x= 5,y=5;
}
static int x,y;
when i use the variables in the main program, it uses the static variable.So in this case, is the scope of the variables only within the static block?
Thank u,
basanti