0
Why cant i declare a static variable in a static function without final.
If the same static variable is declared outside the static function then its is ok but when it is declared inside then the error occurs "illegal modifier for parameter i; only final is permitted", why is this so??
1 Réponse
+ 13
static means that the variable belongs to the class. If a variable is static you can access it without instantiating an object of the class. That's why you can't use static inside a method.