Why there are no global variables in Java? - JAVA Interview Questions

Why there are no global variables in Java?


Global variables are globally accessible. Java does not support globally accessible variables due to following reasons:

  • The global variables breaks the referential transparency
  • Global variables creates collisions in namespace.


Click Here to See Answer .....
Did you like this article ?
Subscribe to my RSS feed and get more JAVA Question, and Guideline, Plus a lot more great advice to help your Software Career.

0 comments:

Related JAVA Questions Posts