C#

C# is a general-purpose, multi-paradigm programming language encompassing strong typing, lexically scoped, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines. It was developed around 2000 by Microsoft as part of its .NET initiative.

C# was designed by Anders Hejlsberg, and its development team is currently led by Mads Torgersen.

var

C# is a strongly typed language which means, you must declare a variable type before you can use it. But what if you don’t know the type of the variable? C# lets you declare local variables without giving them explicit types. It is possible with the help of the “var” type variable.

The “var” keyword is used to declare a var type variable. The var type variable can be used to store a simple .NET data type, a complex type, an anonymous type, or a user-defined type.

Interfaces

A C# interface is a collection of things that we promise to put in our class if we decide to use that interface.

Let's say we have a cat. We can make an interface that a cat can implement, but also dogs, and other animals.

For example we can have an interface called IWalk, ISleep or IEat.

  • csharp.txt
  • Last modified: 2020/04/17 03:06
  • by paul