Jul 21, 2024
Tools > Options
. Increase text size under Environment
and Text Editor
.File > New > Project
Visual C#
and choose Console App (.NET Core)
or other desired templateCreate
using System;
) to import classes and functionsbool
, int
, long
, decimal
, double
, and float
data typesbool canIVote = true; int age = 30;
parse
and toString
methods\n
, \t
, \\
, etc.)+
, -
, *
, /
, %
)++
) and Decrement (--
) operators+=
, -=
, *=
, /=
, %=
)Length
, Contains
, IndexOf
, Remove
, Insert
, Replace
, etc.$
and {}
if...else if...else
>
, <
, >=
, <=
, ==
, !=
) and logical (&&
, ||
, !
) operatorscondition ? consequence : alternative
string canDrive = age >= 16 ? "Yes" : "No";
switch(variable) { case value: //statements; break; ...}
for(initialization; condition; iteration) { //code }
true
try
, catch
, and finally
blocksaccess specifier return_type function_name(parameters) { //code }
Class Animal
with attributes: name, sound, methodsClass Dog inherits Animal
, add unique attributesIDrivable
interface with methods Move
, Stop
delegate
, lambda expressionspublic delegate void Arithmetic(int x, int y);
int[] array = new int[5];
Dictionary<int, string> dict
from item in collection where condition select item
Thread.Sleep(1000);
lock
for thread safety