Skip to content

Files

Latest commit

361618b · Nov 7, 2024

History

History

C#

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Nov 14, 2021
Dec 22, 2022
Aug 19, 2022
Jun 25, 2024
May 24, 2023
Jul 20, 2022
Oct 15, 2023
Nov 7, 2024
May 28, 2024
Sep 27, 2022
Apr 6, 2022
Apr 5, 2022
May 16, 2022
Sep 16, 2022
Sep 22, 2021
Nov 16, 2023
Nov 14, 2021
Oct 24, 2021
Nov 29, 2021
Nov 29, 2021

C#

C# is a modern, object-oriented, and type-safe programming language.

Definition of terms/concepts

Assembly

  • is the unit of packaging and deployment in .NET
  • can be an application or a library

Namespace

  • grouping of .NET types

Expressions

// Example
12 * 30;

Importing

  • to import a namespace with the using directive
// Example
using System;

Identifiers

  • are names that programmers choose for their classes, method, variables and so on.
  • made up of Unicode characters starting with a letter or underscore
  • case sensitive
// Example
System x Console WriteLine

Keywords

  • are names that mean something special to the compiler
  • most of them are reserved, which means you can't use them as identifiers
  • you can use them by adding the prefix @, i.e. @foreach
  • List of C# keywords

Method

  • can receive input data from the caller by specifying parameters and output data back to the caller by specifying a return type
using System;

Console.WriteLine(FeetToInches(37);     // 37 is the argument

int FeetToInches(int feet)              // int feet is a parameter
...

Statements

// Example
int x = 12 * 30;
System.console.WriteLine(x);

Statement block

  • series of statements surrounded by a pair of braces
// Example
{
    int x = 12 * 30;
    System.Console.WriteLine(x);
}

Resource(s)

Books