Why non-static variable cannot be referenced from a static context?

"non-static variable cannot be referenced from a static context" is biggest nemesis of some one who has just
started programming and that too in Java. Since main method in java is most popular method among all beginners and
they try to put program code there they face "non-static variable cannot be referenced from a static context" compiler error when they  try to access a non static member variable inside main in Java which is static. if you want to know
why main is declared static in Java see the link.
Read more »

0 Response to "Why non-static variable cannot be referenced from a static context?"

Posting Komentar