You are on page 1of 4

alt+26 >>> (->)

ctor with tabtab => make constractor


prop with tabtab => make property

fraction >>Meaning F in float number = 43.27F;

Discard >> Meaning _ in int num = 100_000_000; //For Readability

*********

Implicit conversion
int num1 = 10;
double num2 = num1; // Implicit conversion

Explicit conversion>>>>
double num1 = 10.5;
int num2 = (int)num1; // Explicit conversion

*********

String Interpolation >>>>


string firstName = "John";
string lastName = "Doe";
string name = $"My full name is: {firstName} {lastName}";
Console.WriteLine(name);

*********

Use switch case instead of if statement ( if the elements bigger than 5 )


becase the switch case build Jump Table and its take time.

*********
string greeting = "Hello World!";
greeting += " from Tutorials Teacher."; // creates a new string object with new
address

StringBuilder sb = new StringBuilder("Hello World!");


sb.Append("from Tutorials Teacher."); //appends to the same object with same
address

*********

literal Suffix => f in this code


float Mah = 123f;

*********

*********

*********
*********
int [] = { 2 , 3 , 5}

int [,]= { {2 , 3 , 5} , {2 , 3 , 5} }

Judged Array => One D Array of Arrays with different sizes


*********
int i = 1;
object o = i; // boxing >> from value type to Reference
int j = (int)o; // unboxing >> from Reference type to value With explicit Casting

*********
nullable types => ?

int? nullableInt = null;


float? nullableFloat = 3.14f;

> null collapse operator


int M = k ?? 0; >>>> Meaning ig k not equl null put it else put 0

*********

Ram -> Stack & Heap

Calling By value => Stack.


Calling By Reference => Identifier in Stack and it initial Value in Heap.

string s1; => Identifier.

s1 ="Mahfouz";=> Value.

*********

Jume Statment => break , Continue, goto , return

*********

static => shared between all objects.


Instance => every object have new one.

*********
*********

static => Value static for all but can change.


Constent => Value static for all but can't change.

*********

inheritance => PartTimeEmploye : Employe

Polymorphism => Virtual & Override on method

*********

Class Modifiers OR Access Modifiers => Public , Internal (default) ,

*********

argument => send when i calling method.


parameter=> send with Definition.

*********
Ref and Out in Methods => Ref should assign to value in calling
=> out can assign value in method.

*********

OOP - Properties in C#
set and get accessories

*********

Class VS Struct

struct === All data types call by value is struct

=> can't contain Pramaaterless Constractor.


=> support fields but don't support field initializer like => private int id =
100;
but support if it const

=> can't support Finalizer.


=> can't support protected
=> is call by value.
=> imutable

*********

mutable => ‫قابل للتعديل‬

imutable => ‫غير قابل للتعديل‬

*********

Enums => For Readability and ease to use ||| Strongly Typed Named Constants and
support number datatype and can't support string
Flags => Meaning 0 or 1

enum year
{
// items of the enum
January,
February,
March,
April,
May,
June
}

Console.WriteLine(year.January); // January

*********
Inheritance => Readability, reuseability , and avoid DRY .

Polymorphism =>

Abstractions =>
*********

*********

*********

*********

*********

*********

*********

*********

******************

*********

******************

*********

******************

*********

******************

*********

*********

You might also like