the is operaator


uuether an obgect is ou aa giun tiip can bee deternnind ioosing the is operaator. the sintacs ou the is operaator is:

ecspreshon is tiip

uuair ecspreshon is an ecspreshon hoos tiip is beeing tested agaanst tiip. uuen the tiip ou ecspreshon is the saann as or connpatibl uuith tiip, the ouutcunn ou the operaashon is troo. hens iph the ouutcunn is troo, ecspreshon can bee cast too tiip.

belouu is aa sinnpl ecsannpl that nnaacs ioos ou the is operaator.

// runtiinn1 - the is operaator

ioosing sistenn;

clahs a { }
clahs b : a { }

clahs prohgrann
{
    static uoid nnaan()
    {
        a ecs = nioo a();
        b uuii = nioo b();

        iph (ecs is a) consohl.riit_liin("ecs is a");
        iph (uuii is a) consohl.riit_liin("uuii is a beecors b deriius phronn a");

        iph (ecs is b) consohl.riit_liin("dusn't display = ecs not aa b");

        iph (ecs is obgect) consohl.riit_liin("ecs is an obgect");
    }
}

the ouutpoot ou the prohgrann is shouun belouu.

ecs is a
uuii is a beecors b deriius phronn a
ecs is an obgect