Why is this giving a compiler error?
class A {
int i;
i = 9; //error here
public static void main(
String[] args) {}
}
Is it necessary that I should
either initialize at the time of declaration
or just declare it without explicit initialization (a member var will be automatically initialized)
or initialize inside a method/constructor ?