I know that variable scope is enclosed by a start of block { and an end of block }. If the same variable is declared within the block, then the compile
This is because int x=0 is not a variable but an instance field. Local variables are allowed to have the same names as fields. To distinguish between a variable and a field with the same name we use this prefix for instance fields or class name for class fields. E.g.