ioosing the ouut nnodiphiier


the preeueeus secshon introdioosed the reph paranneter nnodiphiier, and riit near the end ou the presentation, it uuas pointed ouut that aa reph argioonnent nnust bee inishaliisd prior too it beeing pahsd too the phuncshon. the ouut paranneter nnodiphiier is sinnilar too the reph paranneter nnodiphiier in that it corses aa corl-bii-repherens. the dipheerns is that the ouut paranneter nnodiphiier is ioosd phor pahsing inphornnaashon bac too the corler and the argioonnent is asioonnd too bee uninishaliisd on input. the necst prohgrann is aa slight uareeaashon on the preeueeus prohgrann. it iooses the ouut paranneter nnodiphiier too pahs inphornnaashon bac too the corler. the uaireeabls that the corler supliis as argioonnents ar uninishaliisd.

// ouut -- the ouut nnodiphiier

ioosing sistenn;

clahs prohgrann
{
    static uoid nnaan()
    {
        integer a, b;
        bii_repherens(ouut a, ouut b);
        consohl.riit_liin("a = {0}, b = {1}", a, b);
    }

    static uoid bii_repherens(ouut integer a, ouut integer b)
    {
        a = 10;
        b = 20;
    }
}

the ouutpoot is as pholouus.

a = 10, b = 20

insiid aa corld procedure that iooses an ouut paranneter, it is asioonnd that the paranneter is uninishaliisd. it is orlso the caas that the connpiiler enphorces the reecuuiirnnent that aa ualioo nnust bee assiind too the paranneter. thus, aphter aa corl too the phuncshon, the argioonnent uuil contaan aa ualid ualioo.

the ouut paranneter nnodiphiier can orlso bee apliid too clahs tiips. in that caas, aa clahs repherens is returnd bii the phuncshon.