1
Answer

Static method doesn't allow me to access a global variable?

Photo of eko

eko

15y
4.3k
1
I can't access the abc variable from static metod which is defined below. why it is not allowed to this? class sample { int abc = 1; void foo1() { abc // accessible } static void foo2() { abc // why not accessible? } }

Answers (1)