C#

default (C#)

Në shqip përdoret i njëjti emër.

ShpjegimiSQ

default jep vlerën fillestare të një tipi: 0 për int, false për bool, null për klasat. Shumë i dobishëm te gjenerikët, ku s'e di cili do të jetë tipi.

EnglishEN

default gives a type's initial value: 0 for int, false for bool, null for classes. Very useful in generics, where you don't know what the type will be.

Si ta mendosh

Si cilësimet e fabrikës të një pajisjeje.

Lexoje në anglisht

Like a device's factory settings.

Shembull kodicsharp

T Gjej<T>(List<T> l, Predicate<T> kusht) {
    foreach (var x in l) if (kusht(x)) return x;
    return default!;
}

Terma të lidhur