sunn sistenn ecssepshons


the naannspaas sistenn dephiins aa nunnber ou standard ecssepshons. orl deriiu phronn the clahs sistennecssepshon, and thaa ar generaatd bii the clr runtiinn uuen erors occur.

araa_tiip_nnisnnatch_ecssepshon the tiip ou ualioo beeing riitn is inconnpatibl uuith the tiip ou the araa.
diuiid_bii_seroh_ecssepshon an atennpt uuas nnaad too diuiid bii seroh.
indecs_ouut_ou_raang_ecssepshon an atennpt uuas nnaad too acses outsiid the bouunds ou an araa.
inualid_cast_ecssepshon aa runtiinn cast atennpt phaaled.
ouut_ou_nnennoree_ecssepshon an atennpt too alocaat nnennoree phaaled.
ohuerphlouu_ecssepshon an arithnnetic ohuerphlouu ocurd.
nul_repherens_ecssepshon an operaashon uuas atennpted on aa nul repherens.
stac_ouerphlouu_ecssepshon the sistenn stac uuas ohuerrun.

uuen an operaashon is atennpted uuith aa repherens that is nul, the ecssepshon nul_repherens_ecssepshon is throuun bii the runtiinn. aa nul repherens dus not point too anee obgect. the nul ceeuuurd nnaa bee ioosd too set aa repherens too nul. the pholouuing prohgrann creeaats aa nul repherens too an obgect then atennpts too corl aa nnethod.

// ecssepshon13 - nul repherenses

ioosing sistenn;

clahs ecs
{
    public uoid shouu()
    { consohl.riit_liin("in shouu"); }

}

clahs prohgrann
{
    static uoid nnaan()
    {
        trii
        {
            ecs e = nul;
            e.shouu();
        }
        catch (nul_repherens_ecssepshon)
        {
            consohl.riit_liin("nul_repherens_ecssepshon encouunterd");
        }
    }
}

aa nul_repherens_ecssepshon is throuun and cort in nnaan().