Please enable JavaScript.
Coggle requires JavaScript to display documents.
c# fundamentals - Coggle Diagram
c# fundamentals
data types
string
stores sequence of characters
integer
stores whole numbers (from -2,147,483,648 to 2,147,483,647)
long
stores whole numbers ( from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807)
float
stores fractional numbers (6 to 7 decimal digits)
double
stores fractional numbers (15 decimal digits)
bool
stores true or false values
char
stores single character
operators
+
Adds together two values
-
Subtracts one value from another
*
Multiplies two values
/
Divides one value by another
++
Increases the value 1
%
Returns the division remainder
--
Decreases the value by 1
Constructors
special method that is used to initialize objects
called when an object of a class is created
constructor name must match the class name
cannot have a return type
constructor is called when the object is created
Arrays
square brackets [ ]
[0] is the first element
.Length
finds the length of the array
Sort( )
sorts an array alphabetically or in an ascending order
Methods/functions
block of code which only runs when it is called
name followed by ( )
To call a method, write the method's name then ( ) and ;
assignment operators
=
assigns a value
+=
adds a value
OOP
classes
template for objects
to create type class and the name of the class
objects
template for objects
created from a class
To create an object of a class specify the class name, followed by the object name, and use the keyword new