Posts

Showing posts from March, 2022

Value types in C#

It's the type of memory in C#. It stores both datatype and value. For instance int a=5; It will be stored as    _____ a |int|5|    ______ Examples to value types 1.All int data types 2.bool 3. Enum 4. Struct Value types are available in both heap and stack.

What's the main role of Garbage collector in C#?

Garbage collection is a background process. It's deallocating the memories of dereferenced objects. Garbage collector has some stages to do this. Such Gen0, Gen 1 and so on.

What's the main purpose of Stack in C#?

Stack is used to trace the method calls of C#. It's handled by Common Language Runtime. Stack has lots of Stack frames. Each stack frame has 3 parts. 1. Parameters 2. Return Address 3.Local variables  Stack frame will be removed from stack when the specific method call completes. In this time the local variables will go out of scope.

Difference between Dropdown list and combo box

Dropdown list 1.Non searchable 2.Can't do multiple selection Combo box 1. Searchable 2. Can do multiple selection