As texts say, Static methods don’t access non-static data, so howcome main() method (declared as static) in nearly all programming languages, is able to work on instance members ?
As texts say, Static methods don’t access non-static data, so howcome main() method (declared
Share
The static
Mainmethod, at least in C# is used to create instances of classes used by the application – these instances are used to access their instance variables.You will see in most applications calls to
newin theMainmethod. This creates an instance of a class that can access instance variables.