How to iterate any Map in C#

karthikeya Boyini
Published on 31-Aug-2018 11:39:43
C# has no built-in Math type. For the same, use a Dictionary. Firstly, create a Dictionary − Dictionary<string, int> d = new Dictionary<string, int>(); d.Add("keyboard", 1); d.Add("mouse", 2); Get the keys − var val = d.Keys.ToList(); Now, use the foreach loop to iterate ... Read More

How to instantiate a class in C#?

Samual Sam
Published on 31-Aug-2018 11:37:18
Use the new operator to instantiate a class in C#. Let’s say our class is Line. Instantiation will create a new object as shown below − Line line = new Line(); Using the object, you can now call the method − ... Read More

How to insert an item in ArrayList in C#?

karthikeya Boyini
Published on 31-Aug-2018 11:34:13
To insert an item in an already created ArrayList, use the Insert() method. Firstly, set elements − ArrayList arr = new ArrayList(); arr.Add(45); arr.Add(78); arr.Add(33); Now, let’s say you need to insert an item at 2nd ... Read More

How to input multiple values from user in one line in C#?

Samual Sam
Published on 31-Aug-2018 11:27:26
Use a while loop to input multiple values from the user in one line. Let’s say you need to get the elements of a matrix. Get it using Console.ReadLine() as shown below − Console.Write("\nEnter elements - Matrix 1 : "); for (i = 0; i < ... Read More

How to initialize a dictionary to an empty dictionary in C#?

Samual Sam
Published on 31-Aug-2018 11:20:50
To initialize a dictionary to an empty dictionary, use the Clear() method. It clears the dictionary and forms it as empty. dict.Clear(); After that, use the Dictionary count property to check whether the list is empty or not − if (dict.Count == 0) { ... Read More

Main thread vs child thread in C#

varma
Published on 31-Aug-2018 11:08:51
Main Thread The first thread to be executed in a process is called the main thread. When a C# program starts execution, the main thread is automatically created. Child Thread The threads created using the Thread class are called the child threads of the main thread. Here is an example ... Read More

Valid variant of Main() in C#

varun
Published on 31-Aug-2018 11:01:53
The Main method is the entry point for all C# programs. It states what the class does when executed. The valid variant of Main() is − static void Main(string[] args Here, static − the object is not needed to access static members void − return type of ... Read More

What are System Programs?

Kristi Castro
Published on 30-Aug-2018 21:22:37
System programs provide an environment where programs can be developed and executed. In the simplest sense, system programs also provide a bridge between the user interface and system calls. In reality, they are much more complex. For example: A compiler is a complex system program. The user view of the ... Read More

Monolithic System Architecture

Alex Onsman
Published on 30-Aug-2018 20:59:40
The entire operating system works in the kernel space in the monolithic system. This increases the size of the kernel as well as the operating system. This is different than the microkernel system where the minimum software that is required to correctly implement an operating system is kept in the ... Read More

Architecture of a Typical Microkernel

Ricky Barnes
Published on 30-Aug-2018 20:42:51
A microkernel is the minimum software that is required to correctly implement an operating system. This includes memory, process scheduling mechanisms and basic inter-process communication. A diagram that demonstrates the architecture of a microkernel is as follows: In the above diagram, the microkernel contains basic requirements such as memory, ... Read More
Advertisements