ProAnswers.org

Can we declare a static variable inside a method?

Static variables are class level variables and they can’t be declared inside a method. If declared, the class will not compile, it generates error message.