Scope of fields
The scope of a field of a class consists of:(1) the bodies of all methods declared in the class and(2) all declarations of fields that follow the declaration of the field.
public class Text
{int x= 5;
int y= x+15;
public void test(int p)
{if (x= p);
{int x= 35;
x= p;
if (p > -p)
x= -p;}
x= p; }