ENع
الدرس 11 · Objects

Exceptions

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

When a method cannot do its job, it throws an exception: an object that carries a message and a stack trace. Follow one through a real program: CheckAge(-5) throws an ArgumentException onto the heap, the runtime unwinds CheckAge's frame off the call stack, Main's catch handles it and prints "Age cannot be negative", and the finally block prints "done". Lines that never run are skipped.

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

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