C# is a modern, object-oriented, and type-safe programming language.
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);
}
Books