C# ile sınıf üyeleri | Members | #shorts



C#’ta sınıf üyeleri ikiye ayrılır. Static üyeler ve instance üyeler. Static üyelere sınıfın kendi ismi üzerinden erişilir fakat instance üyelere o sınıftan oluşturulan bir nesne üzerinden erişilir.

// C# – Üyeler (Static ve Instance)

Point p = new Point();

Console.WriteLine(p.Y);
Console.WriteLine(Point.X);
class Point
{
public static int X { get; set; }
public int Y { get; set; }
}

// Constant, field, metod, property
// indexer, event

#shorts #short

Kaynaklar:

https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/members

***

Sosyal Medya

🐦 Twitter’dan takip edin: https://twitter.com/sonergonul
💜 Twitch’ten takip edin: https://www.twitch.tv/sonergonul
💚 Discord kanalımız: https://discord.gg/VXZQH3U
💖 Quora’dan takip edin: https://www.quora.com/profile/Soner-Gonul
💛 Instagram’dan takip edin: https://www.instagram.com/sonergonul/

Destek

💪 ByNoGame: https://www.bynogame.com/destekle/sonergonul
💪 Stremlabs: https://streamlabs.com/sonergonul/tip