when I am coding this at class level

```
int a;
a=5;

```

it throws error : "identifier expected"

But when I declare it as a local variable like  

```
void m1() {
    int a;
    a=5;
}

```

No error is thrown.