posted 8 years ago
Inside the class (and outside of any methods or initialization blocks) you can only have variable declarations. You cannot initialize a variable in a separate statement. Initializing with declaration is allowed as after all it is a declaration. So if you want to initialize i in class A, then either initialize it in the declaration or in a initializer block...