Thanx loga,
But why?
A variable declared in a class level and when it is initiallised later is not compiling.And how it is compiling when initialised within a block.What significance it has?But whereas a variable declared within a method accepts initialisation later before it is being referred.
Ex:
Public class
Test {
int k;
k=10;
} //this class not compiles
class Test1 {
int k;
{
k=10;
} //this class compiles
class Test2 {
public void comp() {
int k;
k=10;
}
} //this also compiles
A brief explination why and how?
Thanx
Renga