Posts

Showing posts from February, 2021

Concept Of Collection in Dot NET Day 23

Understanding Boxing & Unboxing Day 22

Image
Lecture 22 : Understanding Boxing & Unboxing Boxing : Boxing is used to store value types in the garbage-collected heap. Boxing is an implicit conversion of a value type to the type  object  or to any interface type implemented by this value type. Boxing a value type allocates an object instance on the heap and copies the value into the new object. Consider the following declaration of a value-type variable :                                   int  i =  123 ; The following statement implicitly applies the boxing operation on the variable i :           // Boxing copies the value of i into object o.                                object o = i; The result of this statement is creating an object reference o, on the stack, that references a value of the type int , on the heap.  This value is a copy of the value-type value assigned to the variable i.  The difference between the two variables, i and o, is illustrated in the following image of boxing conversion : It is also po

Learn Garbage Collection Day 21

Image
Lecture 21 : Learn Garbage Collection Garbage Collection : The garbage collection (GC) manages the allocation and release of memory.  The garbage collector serves as an automatic memory manager.  When there isn’t enough memory to allocate an object, the GC must collect and dispose of garbage memory to make memory available for new allocations. This process is known as  garbage collection . Garbage collection in the following advantages   : It also allocates objects on the managed heap efficient. When objects are no longer used then it will reclaim those objects by clearing their memory, and keeps the memory available for future allocations. Managed objects automatically get clean content to start with, so their constructors do not have to initialize every data field. How GC runs at the Background : Garbage collector runs at the background process . Garbage collector runs at the undetermestic . In background garbage collection (GC), as needed while the collection of progress

Primitive Data Type In C Sharp Day 20

Image
Lecture 20 : Primitive Data Type In C Sharp Primitive Data Type : The primitive types are predefined by the language and they are named by reserved keywords.  They represent the basic types of the language. Stack : A stack is a special area of computer's memory which stores temporary variables created by a function.  In stack, variables are declared, stored and initialized during runtime. It is a temporary storage memory. When the computing task is complete, the memory of the variable will be automatically erased.  The stack section mostly contains methods, local variable, and reference variables. Heap : The heap is a memory used by programming languages to store global variables.  By default, all global variable are stored in heap memory space.  It supports Dynamic memory allocation. The heap is not managed automatically for you and is not as tightly managed by the CPU.  It is more like a free-floating region of memory. Difference between Stack & Heap ? The Stack

Numeric Data Type In C Sharp Day 19

Image
Lecture 19 : Numeric Data Type In C Sharp Numeric Data Type : The n umeric types  represent integer, decimal and double numbers. In this article with a quick reference to the numeric data types.  For integer types, the declaration keyword, a description of the type, the range of possible values and the number of bits used to represent the value are given.  For non-integers, the scale and the number of digits of accuracy are given, rather than minimum and maximum .  This allows you to determine which data type should be used for any numeric variable. The Boolean type is included, which although not technically numeric, fits well in this table.  The Boolean type can hold either true or false. Integer : The int data type is 32-bit signed integer. It can store numbers from -2,147,483,648 to 2,147,483,647 .  The int keyword is an alias of Int32 struct in .NET. The uint is 32-bit unsigned integer.  The uint keyword is an alias of UInt32 struct in .NET.  It can st