1
Answer

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

eko

eko

12y
3.9k
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)