Thursday 7 April 2016

C# Introduction, version and features


C# pronounced as C-Sharp, C# is totally based on OOP(Object Oriented Programming), OOPs contain inheritance, encapsulation, polymorphism, abstraction.

C# Version History
Version
.Net Framework
Visual Studio
C# 1.0
.Net Framework 1.0
VS 2002
C# 2.0
.Net Framework 2.0
VS 2005
C# 3.0
.Net Framework 3.0\3.5
VS 2008
C# 4.0
.Net Framework 4.0
VS 2010
C# 5.0
.Net Framework 4.5
VS 2012 / 2013
C# 6.0
.Net Framework 4.6
VS 2015

  1. C# 2.0
    1. Generic
    2. Partial types
    3. Anonymous methods
    4. Iterators
    5. Nullable types
    6. Getter / Setter (get; set;) separate accessibility
    7. Method group conversions(delegates)
    8. Static Classes
    9. Delegate interface
  2. C# 3.0
    1. Implicitly typed local variables
    2. Object and collection initializer
    3. Auto implemented properties
    4. Anonymous types
    5. Extension methods
    6. Query expressions
    7. Lambda expression
    8. Expression trees
    9. Partial methods
  3. C# 4.0
    1. Dynamic binding
    2. Named and optional arguments
    3. Generic co – and contra variance
    4. Embedded interop types
  4. C# 5.0
    1. Asynchronous methods
    2. Caller into attributes
  5. C# 6.0
    1. Compiler as a services
    2. Import of static type members into namespace
    3. Exception filters
    4. Await in catch/finally/blocks
    5. Auto property initializers
    6. Default values for getter only properties
    7. Expression bodied members
    8. Null propagator
    9. String interpolation
    10. Nameof operator
    11. Dictionary intializer



C# (C-Sharp)

  • C# is an object – oriented programming language
  • C# was developed specifically for .Net
  • C# is used mostly for writing windows application
  • C# is run on the .Net platform
  • C# is based on C/C++, VB and JAVA
  • C# is a simple, powerful and productive language



The core syntax of c# language is similar to c and c++ Semicolons are used to denote the end of a statement. Curly brackets are used to group statements. Variables are assigned values using an equal sign. Square brackets are used with arrays.

Distinguishing features
Portability, Typing, Meta programming, Methods and functions, Property, Namespace, Memory access, Exception, Polymorphism, Functional programming

Boxing and Unboxing

int foo = 2;
object obj = foo;
int foo2 = (int)obj;

Example Simple "Hello World"

using System;

class Program
{
    static void Main()
    {
        Console.WriteLine("Hello, world!");
    }
}



No comments:

Post a Comment