O'Reilly logo

Extending Microsoft Dynamics NAV 2016 Cookbook by Alexander Drogin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding static classes and methods

All DotNet variables used in the previous recipe had to be instantiated before they could be used, which means that methods called on such variables are executed on a particular instance of that class. Static methods belong to the class itself and can be called without instantiating the variable.

The whole class can be declared as static. In this case, the class does not implement any constructor and all its methods have to be also static. An example of a static class is File--a .NET class encapsulating file operations.

A non-static class can implement both instance and static methods. RegEx is an example of a class that has both static and instance methods. RegEx is a .NET implementation of regular expressions. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required