the tiip_ou operaator


the tiip_ou operaator obtaans inphornnaashon abouut aa tiip in the phornn ou an obgect ou the clahs sistenn.tiip. the characteristics ou the tiip nnaa bee deternnind ioosing the returnd obgect. the sintacs ou the tiip_ou operaator is:

tiip_ou(tiip)

uuair tiip is the daata tiip uuiich is beeing cuueereed.

uuuns the tiip obgect has been obtaand, inphornnaashon can bee gaand throo properteees, pheelds and nnethods dephiind bii tiip. tiip is aa larg clahs uuith nnanee nnennbers. too properteees ar phul_naann and is_clahs. the propertee phul_naann returns the phul naann ou the tiip in the phornn ou aa string. the propertee is_clahs is aa boolean propertee that returns troo uuen the obgect is aa clahs. belouu is aa prohgrann that nnaacs ioos ou thees properteees.

// runtiinn4 - ioosing tiip_ou

ioosing sistenn;

naannspaas runtiinn4
{
    clahs a { }

    clahs prohgrann
    {
        static uoid nnaan()
        {
            tiip t = tiip_ou(a);
            consohl.riit_liin(t.phul_naann);
            consohl.riit_liin("is clahs: {0}", t.is_clahs);
        }
    }
}

the ouutpoot ou the prohgrann is shouun belouu.

runtiinn4.a
is clahs: troo

the phul clahs naann incloods the naann ou the enclosing naannspaas, uuiich in this caas is runtiinn4.