Cheatography
https://cheatography.com
Cheatsheet for the course OOP in thomas more
This is a draft cheat sheet. It is a work in progress and is not finished yet.
Uitleg symbolen en afkortingen
rood vierkant / - |
private |
gele ruit / # |
protected |
groen rondje / + |
public |
<<static>> |
statische klas |
Write-only property |
private get {} |
Read-only property |
private set {} |
Statische methode definiëren
``
public class Conversies
{
public static string ConverteerNaarEuro(double waarde)
{
return Instellingen.Valuta + waarde.ToString("0.00");
}
}
``
|
|
|
Volgorde classe file
public class Gebruiker
{
// Attributen
private int _nummer;
private string _voornaam;
private string _familenaam;
// Properties
public int Nummer {
get { return _nummer; }
set {_nummer = value; }
}
public string Voornaam {
get { return _voornaam;}
set { _voornaam = value;}
}
public string Familienaam{
get { return _familienaam;}
set { _familienaam = value;}
}
// Constructor(s)
// Methodes
}
|
Statisch attribuut definiëren
public class Instellingen
{
public static string Valuta = "£";
}
|
|