Why does Java not support global variables?

John Mitchell

Because the designers of the language wanted a more pure object-oriented language than e.g., C++. Global variables just clutter up languages with no real benefit while introducing a number of problems such more layers of scoping and life-cycle timing issues. Switch your thinking over to more pure OO and you'll definitely be better off. :-)

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact