What is C#?

C# removes some of the complexities and pitfalls of languages such as Java and C++, including the removal of macros, templates, multiple inheritance, and virtual base classes. These are all areas that cause either confusion or potential problems for C++ developers.

First C# Program (Hello World)

using System;

class Hello

{

static void Main()

{

Console.WriteLine("Hello world");

}

}


Type System:-

  • Value types
    • Primitives int i;
    • Enums enum State { Off, On }
    • Structs struct Point { int x, y; }
  • Reference types
    • Classes class Foo: Bar, IFoo {...}
    • Interfaces interface IFoo: IBar {...}
    • Arrays string[] a = new string[10];
    • Delegates delegate void Empty();

Predefined Types:-

  • C# predefined types
    • Reference object, string
    • Signed sbyte, short, int, long
    • Unsigned byte, ushort, uint, ulong
    • Character char
    • Floating-point float, double, decimal
    • Logical bool
  • Predefined types are simply aliases for system-provided types For example,
    • int == System.Int32

You may also like

What is PHP?

PHP stands for PHP: Hypertext pre-processor, with that PHP standi...

What is ASP.NET?

ASP.NET, the next version of ASP, is a programming framework used...

What is Data Structure?

A data structure is a group of data elements grouped together und...

What is C#?

C# removes some of the complexities and pitfalls of languages suc...

What is Math?

Math is no Definition it has only Calculation.Closure Property of...

What is Oracle?

Based in Redwood, California, Oracle Corporation is the largest s...

Function in java

A function in Java language is a block of code that performs a sp...

Do-While Loop in java

The do-while loop looks like this:do{ this ; and this ; and this ...