Colon is used as inheritance operator in C#. Just place a colon and then the class name.
Example: public class DerivedClass : BaseClass
"is" operator is used to checking the compatibility of an object with a given type and it returns the result as Boolean.
"as" operator is used for casting of an object to a type or a class.
Yes! C# is managed code because it uses Common language runtime(CLR) to compile C# code.
Public: The keyword public is an access modifier that tells the C# compiler that the Main method is accessible by anyone.
Static: The keyword static declares that the Main method is a global one and can be called without creating an instance of the class. The compiler stores the address of the method as the entry point and uses this information to begin execution before any objects are created.
Void: The keyword void is a type modifier that states that the Main method does not return any value.
“CopyTo()” method can be used to copy the elements of one array to other.
“Clone()” method is used to create a new array to contain all the elements which are in the original array.
Partial classes concept added in .Net Framework 2.0 & it allows us to split the business logic into multiple files with the same class name along with “partial” keyword.
6. Bit Array
It is a feature of modern OS with which we can run multiple programs at the same time.
Example: Word, Excel etc.
It is a subset of multitasking. Instead of switching between programs this feature switches between different part of the same program.
Example: Writing in MS-Word and It also checking spelling using spell-checker in the background
It is a basic unit to which OS allocates processor time.
Example: .Net Framework program has at least 2 threads running one is the main program & Second is Garbage collector(GC).
Syntax to change thread priority
Threading.Priority = Threadpriority.priorityUnit;
Levels of priority
1) Threadpriority.Highest (10)
2) Threadpriority.Abovenormal (7)
"Thread.Currentthread" refers to the current thread running the method.
It is public static property.
Thread execution can be paused by calling the Thread.Sleep method. This method takes on integer value that determines how long the thread should sleep
Example: Thread.currenttime.sleep(2000) // 2 Seconds
To interrupt this sleep method you can call-
It is similar to sleep & interrupts. Suspend allow you to block thread until another thread calls thread.resume.
The difference between sleep & suspend is that suspend does not immediately place a thread in a wait state. the thread does not suspend until the .Net runtime determines that it is in a safe place to suspend it. Sleep will immediately place a thread in a wait state.