Sunday, 4 October 2020

Learn OOP with C#

C# an Introduction.


It is one of the languages which evolved from C programming like C++ with object-oriented development. It has a feature named 'Garbage Collection' which makes beginners understand them easily and quickly. This allows C# to stand different from C and C++.




Some of its features are:
  • Object-Oriented
  • Comes with an extensive class library
  • Supports exception handling.
  • Multiple types of polymorphism
  • Separation of interfaces from implementations.
Mostly, C# is used to develop desktop apps and games. It has powerful development tools, multi platform support and generics makes C# a good choice.

C# is used for:
  • Rapid application development projects.
  • Projects implemented by small or large teams.
  • Internet/Web applications.
  • Projects with strict reliability requirements.
C# is case-sensitive. That means name and Name are not the same variables here.

Sample Hello World Program in C#:

//Declaration of namespace
Using System;

//Beginning of the start class
Class HelloWorld
{
    //Main program begins here
    Static void Main()
    {
       //writing to console
       console.Writeline("Hello World!");
    }
}

Output =>  Hello World!

From the above example, you can understand that a program here has consist of 4 basic parts namely,
  1. namespace declaration
  2. a class
  3. main method
  4. program statement 
Recommended IDE to use is : Visual Studio .

No comments:

Post a Comment

Why to learn java?

Java is a high-level programming language originally developed by Sun Microsystems and released in 1995. Java runs on a variety of platforms...