Question: what is the difference between local variable and class variable?
Answer: Local variables are not visible outside the method. Instance variables are declared in a class, but outside a method. They are also called member or field variables. ... Class/static variables are declared with the static keyword in a class, but outside a method.