ENع
الدرس 10 · Objects

Null and nullable types

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

null means "no object". Follow a seven-line program that keeps three variables honest: string? marks a reference that may be null, int? (Nullable<int>) gives a value type a HasValue flag, ?. and ?? turn a missing value into a safe default, ??= fills in a null, and the compiler, Roslyn, tracks which variables may be null so you fix a NullReferenceException before it ever happens. The program prints 33.

12 دقيقة9 خطوات5 أسئلةIntermediate
شكل 10 · تفاعلي
جارٍ تحميل الرسم…
أو ← →

اختبار يتاح بعد الخطوة الأخيرة.