Static and Non Static Member in C# | Core Spider

Опубликовано: 12 Март 2020
на канале: Jayant Tripathy
773
9

#static #non-static #member #coreprogramm

In this video we covered what is Static and Non Static Member in C#.

What are static and non-static members in C#?
When do we need to use static and non-static members in C#?
Static and Non-static variables in C#.
What is the scope of Non-Static variables in C#?

What are static and non-static members in C#?

The member of a class is divided into two categories
Static members - The members of a class which does not require an instance for initialization or execution are known as the static member.
Non-static members - The members which require an instance of a class for both initialization and execution are known as non-static members.
When do we need to use static and non-static members in C# ?

Whenever we declare a variable by using the static modifier or when we declare a variable inside of any static block then those variables are considered as static variables whereas the rest of the other are considered as non-static variables.

Rules to follow while working with static and non-static members in c#:

Non-static to static: Can be consumed only by using the object of that class.
Static to static: Can be consumed directly or by using the class name.
Static to non-static: Can be consumed directly or by using the class name.
Non-static to non-static: Can be consumed directly or by using the “this” keyword.

   • Static Class in C# | When to use stat...  

https://www.coreprogramm.com/2020/02/...

Don't forget to subscribe to "CoreProgramm" !

http://corespider.com/
Website : https://www.coreprogramm.com/
Facebook :   / coreprogramm  
Twitter :   / coreprogramm  
Instagram :   / thecoreprog.  .
Github : https://github.com/CoreProgramm


Смотрите видео Static and Non Static Member in C# | Core Spider онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Jayant Tripathy 12 Март 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 773 раз и оно понравилось 9 людям.