this keyword
Aanroepen van instantievariabelen met zelfde naam


Object geeft zichzelf mee als parameter
Last updated
Was this helpful?


Last updated
Was this helpful?
Was this helpful?
internal class Management
{
private const int MAXRANG = 10;
public static bool MagPromoveren(Werknemer toCheck)
{
return toCheck.Rang < MAXRANG;
}
}internal class Werknemer
{
public int Rang { get; set; }
public bool IsPromoveerbaar()
{
return Management.MagPromoveren(this);
}
}Werknemer francis = new Werknemer();
if(francis.IsPromoveerbaar())
{
Console.WriteLine("Jeuj!");
}