C# is a modern, general-purpose, object-oriented programming language created as a rival to Java.
C# was designed by Anders Hejlsberg at Microsoft late in the 1990s and was part of Microsoft's overall .NET strategy. It was first released in its alpha version in the middle of 2000.
Although Java programs can be executed in a Windows environment (assuming that the Java Virtual Machine (JVM) has been installed), Java and Windows are not closely coupled. Since Windows is the most widely used operating system in the world, lack of direct support for windows is a drawback to Java. To answer these and other needs, Microsoft developed C#.
C# is purely object oriented programming language because without class and object it is impossible to write any C# program. But, it supports primitive data types like int, float, boolean, double, long etc., which are not objects.
C# and Java have a bit more complicated relationship. As explained, Java is also descended from C and C++. It too shares the C/C++ syntax and object model.
Like Java, C# is designed to produce portable code. However, C# is not descended from Java. Instead, C# and Java are more like cousins, sharing a common ancestry, but different is many important aspects.
C# can be used to create almost anything but is particularly strong at building Windows desktop applications and games. The following is the list of few examples of where C# programming is used.