nika Posted March 29, 2014 Share Posted March 29, 2014 i am quite confuse about accesses non static methods via static context. for example: class Test{ function Test(){ } } you can accesses this method without creating object, how is it possible? Test::Test(); then why we need to write static ahead that method? what the difference between static function Test() and function Test()? Link to comment Share on other sites More sharing options...
Larry Posted April 1, 2014 Share Posted April 1, 2014 A non-static method can be accessed without instantiation (creating an object) or with instantiation. The static keyword is not really a restriction, it's a way to make a class or function be globally shared and accessible. Link to comment Share on other sites More sharing options...
Recommended Posts