Saturday, March 3, 2018

Tutorial 9 Classes and its components

What are Classes ?

Classes are collection of Data Types and methods. in Simple terms we can say a Class is a Codeunit of NAV and inside codeunit we can define multiple variables called datatypes and functions as we normally do in NAV.

As per need , we have codeunit type : Single Instance Codeunit and many events are introduced from NAV 2016. Like the same, we have multiple types of classes in dotnet. Lets see all now :

With Classes we come to following terms to understand :

1. Constructor 

Constructors are basically used to initialize class object / data types in dotnet

2. Destructor

This is used for cleaning the variables and in new versions of dotnet it is not required to define. It is done with tilt sign before class name. 

3. Overloading of Constructor 

We can define multiple constructors based on parameters for one class and these are basically termed as overloading.

Dotnet itself create on constructor for us when we define a class.
Constructor have same name as class and no return type.

Note please Dont mug up , just try and learn the use.

4. this Keyword

this keyword is pointing to the objects or variables defined in classes.

So lets have one screenshot for reference :






No comments:

Post a Comment