C#

Classes & objects in C#

Në shqip: Klasat dhe objektet në C#

ShpjegimiSQ

Në C#, një class është plani dhe me new krijon objekte prej tij. Klasa ka fusha, veti, metoda dhe konstruktorë. Pothuajse çdo gjë në C# jeton brenda një klase.

EnglishEN

In C#, a class is the blueprint and new creates objects from it. A class has fields, properties, methods and constructors. Almost everything in C# lives inside a class.

Si ta mendosh

Si kallëpi i biskotave dhe biskotat që del prej tij.

Lexoje në anglisht

Like a cookie cutter and the cookies it makes.

Shembull kodicsharp

class Lojtar {
    public string Emri { get; set; } = "";
    public void Luaj() => Console.WriteLine($"{Emri} po luan");
}
var l = new Lojtar { Emri = "Arta" };

Terma të lidhur