siva,
What is difference in the following declarations
int i=5; //1
and
int i; i=5;//2
I am not clear about what difference you are seeking for anyway here is the difference between the two.There are various places of declarion of variable in a class body.
//1 can be declared at instance initializers,in static block,in instance block,in constructors,method body,for-loop body etc.
//2 can not be initialized as instance initializers otherwise can be initialized at the places where // can be.