can a static function have a non static variable?
add a comment |. up vote 0 down vote. Static variables are class variable not instance or local variable. that is why we can use static variable in non static method also. and static variables are not per object. static variables have one copy that will be used in entire program. share | improve this answer. answered May 18 at 9:41.