MSIL Trivia – 4 (Spot the difference)

I have created a very simple C# console application which gives me the following MSIL code when compiled… The next screenshot has almost the same code but with some special difference. Can you tell me what could have caused it and is it good or bad?   I will answer this in the comments (or…

4

MSIL Trivia – 3 (Constructors in .NET)

Background: Let’s write the following code in C# (cons.cs) using C = System.Console; public class X {     int i, j;     public X()     {     }     public X(int i)     {         this.i = i;     }     public X(int i, int j)     {         this.i = i;         this.j =…

1

Trading Calculator for my friends :-)

I am quite new to share market and I see that a lot of my colleagues here use it for investment. With the markets going up and down like crazy, it gives tonnes of opportunities of making your portfolio a bit better over time. I created a small and handy calculator which helps you in…

4

MSIL Trivia – 2 (Setters in C#)

Background: Let’s create a setter in C# with a simple getter and setter… using System; class Employee {    private string name;    public string Name    {       get       {          return name;       }       set       {          name=value;       }    } } class App {    public static void…

2

MSIL Trivia – 1

Background: If you have multiple Main methods in your C# console application, you will be able to compile the application only if you provide the /main:ClassName on your command prompt. For ex. create a file called SampleMSIL.cs and paste the following… using System; class AA {    public static void Main()    {       Console.WriteLine("In…

1