- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
The best IDE for C# on Windows is Microsoft Visual Studio. It is an IDE to develop websites, web apps, mobile apps, etc.The following are the features of Visual Studio IDE−Code Editor − Visual Studio has a code editor supporting syntax highlighting and code completion using IntelliSense.Breakpoints − Set breakpoints and allow monitoring the variable values as the execution progress.Extend Capability − With Visual Studio, you can extend the functionality of the IDE. The extension includes macros, packages, etc.Built-in-languages − Visual Studio supports more than 30 programming languages, including C#, F#, JavaScript, TypeScript, etc.
Dictionary is a collection of keys and values in C#. Dictionary is included in the System.Collection.Generics namespace.To declare and initialize a Dictionary −IDictionary d = new Dictionary();Above, types of key and value are set while declaring a dictionary object. An int is a type of key and string is a type of value. Both will get stored in a dictionary object named d.Let us now see an example −Exampleusing System; using System.Collections.Generic; public class Demo { public static void Main() { IDictionary d = new Dictionary(); d.Add(1, 97); d.Add(2, ... Read More
Generic List is a generic collection in C#. The size can be dynamically increased using List, unlike Arrays.Let us see an example −We have set the List first −List myList = new List()Now add elements in the list −List myList = new List() { "mammals", "reptiles", "amphibians" }Now using a property let us count the number of elements added −Exampleusing System; using System.Collections.Generic; class Program { static void Main() { List myList = new List() { "mammals", "reptiles", "amphibians" }; Console.WriteLine(myList.Count); } }
The alternative for Visual Studio IDE to run C# programs −SharpDevelopIt is an open source IDE to run C# programs but works only Microsoft Windows. SharpDevelop was developed as an alternative to Visual Studio. It is written in C#. Supports Git, SVN, NuGet, LINQPadIt is a utility that allows you to run C# programs without having an IDE. Some of the features in LINQ Pa d is paid like autocomplete and allows the user to access it only after the payment.MonodevelopIt is an open source IDE that allows you to run C# on multiple platforms i.e. Windows, Linux, and MacOS. ... Read More
In a Dictionary collection, store any data type. Dictionary is a collection of keys and values in C#. Dictionary is included in the System.Collection.Generics namespace.Let us now see the best way to iterate over a Dictionary in C# −Firstly, let us create a dictionary −var d = new Dictionary(5);Now add the key and value −// add key and value d.Add("car", 25); d.Add("bus", 28); d.Add("motorbike", 17);Use orderby to order by values −var val = from ele in d orderby ele.Value ascending select ele;We have set ascending above to sort the dictionary in ascending order. You can also use descending.Display the values ... Read More
On Windows, the best IDE to run C# programs is Visual Studio. On Linux, the best IDE can be considered as Monodevelop. It is an open source IDE that allows you to run C# on multiple platforms i.e. Windows, Linux and MacOS. Monodevelop is also known as Xamarin Studio. It has a C# compiler to run C# programs.Monodevelop has the following features −Multi-platform IDESupports Linux, Windows and macOS.Supports multiple languagesMonoDevelop supports multiple languages such as C#, F#, Visual Basic .NET, etc.Integrated DebuggerIt comes with an integrated debugger for debugging Mono and native applications.Code CompletionCode completion support for C#, code templates, ... Read More
Thread pool in C# is a collection of threads. It is used to perform tasks in the background. When a thread completes a task, it is sent to the queue wherein all the waiting threads are present. This is done so that it can be reused.Let us see how to create a thread pool.Firstly, use the following namespace −using System.Threading;Now, call the threadpool class, using the threadpool object. Call the method QueueUserWorkItem −ThreadPool.QueueUserWorkItem(new WaitCallback(Run)); Iterate this in a loop and compare it with a normal Thread object.
Increment OperatorsTo increment a value in C#, you can use the increment operators i.e. Pre-Increment and Post-Increment Operators.The following is an example −Exampleusing System; class Demo { static void Main() { int a = 250; Console.WriteLine(a); a++; Console.WriteLine(a); ++a; Console.WriteLine(a); int b = 0; b = a++; Console.WriteLine(b); Console.WriteLine(a); b = ++a; Console.WriteLine(b); Console.WriteLine(a); ... Read More
A delegate that holds a reference to more than one method is called multicasting delegate.Let us see an example −Exampleusing System; delegate void myDelegate(int val1, int val2); public class Demo { public static void CalAdd(int val1, int val2) { Console.WriteLine("{0} + {1} = {2}", val1, val2, val1 + val2); } public static void CalSub(int val1, int val2) { Console.WriteLine("{0} - {1} = {2}", val1, val2, val1 - val2); } } public class Program { static void Main() { myDelegate d = new myDelegate(Demo.CalAdd); ... Read More
A Jagged array is an array of arrays in C#. You can declare and initialize it −int[][] rank = new int[1][]{new int[]{5,3,1}};The following is an example showing how to work with jagged arrays in C# −Exampleusing System; namespace Program { class Demo { static void Main(string[] args) { int[][] rank = new int[][]{new int[]{1,2},new int[]{3,4}}; int i, j; for (i = 0; i < 2; i++) { for (j = 0; j < 2; j++) { Console.WriteLine("a[{0}][{1}] = {2}", i, j, rank[i][j]); } } Console.ReadKey(); } } }OutputAbove, we have a jagged array of 2 array of integers −int[][] rank = new int[][]{new int[]{1,2},new int[]{3,4}};
To Continue Learning Please Login
Login with Google