if we try to do
class A{
int a = 5 ;
a=6; // we will get error
}
i saw this question it like mine but not the same Why can't I do assignment outside a method?
but the answers did not convince me as here
we see that declaration are statement as well as assignment so the class braces should be the block of code containing them, also every statement is inside a block of code for sure in class as a top level or methods as a lower so how they say a statement must be only inside a block of code?
i need an answer or a reference please? thanks for reading.