C#

Properties (get; set;)

Në shqip: Vetitë në C#

ShpjegimiSQ

Vetitë (properties) në C# duken si fusha, por nga brenda janë metoda get dhe set. { get; set; } krijon një veti automatike në një rresht; kur të duhet, i shton rregulla — p.sh. mosha s'mund të jetë negative.

EnglishEN

Properties in C# look like fields, but inside they're get and set methods. { get; set; } creates an automatic property in one line; when you need to, you add rules — e.g. age can't be negative.

Si ta mendosh

Si sporteli i bankës që duket si dritare e thjeshtë, por pas saj dikush kontrollon çdo kërkesë.

Lexoje në anglisht

Like a bank counter that looks like a simple window, but behind it someone checks every request.

Shembull kodicsharp

public class Nxenes {
    public string Emri { get; set; } = "";
    public int Mosha { get; private set; }
}

Terma të lidhur