
function overloading

chila prograaming bhashakalil, function overloading allengil reethi overloading ennathu vyathyastha nadappaakkalukalode ore peril onniladhikam functionukal srishtikkaanulla kazhivaanu. overload cheytha functionilekkulla kolukal kolinte sandarbhathinu anuyojyamaaya aaa functionte oru prathyeka nadappaakkal pravartthippikkum, ithu oru function koline sandarbhathe aashrayich vyathyastha jolikal cheyyaan anuvadikkunnu.
udaaharanathinu, avaa overload cheytha functionukalaanu. randaamathethu vilikkaan, oru object oru paaraameteraayi paas cheyyanam, athesamayam aadyathethinu oru paaraameettar aavasyamilla, koodaathe shoonyamaaya paaraameettar feeld upayogichu vilikkunnu. randaamathe functionile objectinu oru sthirasthithi moolyam nalkuka ennathaanu oru saadhaarana pishak, ithu "avyakthamaaya kooll" pishakin kaaranamakum, kaaranam rund reethikalil eathaanu upayogikkendathennu compilerinu ariyilla.
mattoru udaaharanam athu tekst allengil phottokal print cheiyunnundo ennathine adisthaanamaakki vyathyastha pravartthanangal nadappilaakkunna oru functionaanu. rund vyathyastha functionukalum overload cheythekkaam, nammude prograam "print" cheiyunna ellah objectukalkkum overload cheytha print functionukal ezhuthunnathu pole, objectinte tharathekkurichu nammal orikkalum vishamikkendathilla, sariyaaya function kooll veendum, kooll ellaayppozhum
overloadingine pinthunaykkunna bhashakal.
function overloadingine pinthunaykkunna bhashakalil inipparayunnava ulppedunnu, ennaal avayil maathram parimithappedunnilla
function overloadingile niyamangal.
ithu staatik polymorphysatthinte oru vargeekaranamaanu, athil chila "bestt maachu" algoritam upayogichu oru function kooll pariharikkappedunnu, avide vilikkanulla prathyeka function yadhaartha paaraameettar tharangalumayi aupachaarika paaraameettar tharangalude mikacha poruttham kandethunnathiloode pariharikkappedunnu. eee algorithathinte vishadaamshangal bhasha anusarichu vyathyaasappedunnu.
function overloading saadhaaranayaayi function kolukalil type checking nadappilaakkunna staattikkali type cheytha prograaming bhashakalumaayi bandhappettirikkunnu. overload cheytha function yadhaarthathil ore perulla vyathyastha functionukalude oru koottam maathramaan. eathenkilum prathyeka kolinu, eathu overload cheytha functionaanu upayogikkendathennu compiler nirnnayikkukayum compile samayat ithu pariharikkukayum cheiyunnu. jaava polulla prograaming bhaashakalude kaaryatthilum ithu sariyaanu.
jaavayil, function overloading compile-time polymorphism, staatik polymorphism ennum ariyappedunnu.
function overloading rantaim samayat thiranjedukkunna polymorphysatthinte roopangalumaayi thettidharikkaruthu, udha.jii. sthiramaaya pravarthanangalkku pakaram vertual functionukaliloode.
udaaharanam sii yill function overloading++
oru cubinte int vooliyam (ints) {// vooliyam.
 s * s * s thirike nalkuka;
oru silindarinte eratta vooliyam (eratta r, inttu echu) {// vooliyam.
 3.1415926 * r * r * staatik _ kaast <double> (echu);
oru cuboidinte dairkhyameriya vooliyam (neelamulla l, int b, int h) {// vooliyam.
 thirike ell * bii * echu;
int maine () {
 STD:: cout "vooliyam (10);
 STD:: kauttu vooliyam (2.5,8);
 STD:: kauttu vooliyam (100l, 75,15);
melpparanja udaaharanathil, oro gadakathinteyum vooliyam kanakkaakkunnath "vooliyam" enna moonnu functionukalilonnu upayogichaanu, vyathyastha samkhyayeyum yadhaartha paaraamettarukalude tharatheyum adisthaanamaakki thiranjedukkunnu.
kanstraktar overloading.
oru vasthuvinte udaaharanagal srishtikkaan upayogikkunna nirmmathaakkal chila object ooriyantad prograaming bhaashakalilum overload cheythekkaam. kaaranam pala bhaashakalilum kanstraktarude peru klaasinte peril munkootty nirnnayikkappedunnathil, oru kanstraktar maathrame undaakoo ennu thonnunnu. onniladhikam nirmmathaakkal aavasyamullappozhellaam avaa overload cheytha pravarthanangalaayi nadappilaakkanam. sii + + ll, sthirasthithi nirmmathaakkal paaraamettarukal edukkunnilla, object amgangale avayude uchithamaaya sthirasthithi moolyangal upayogichu thalkshanam nalkunnu, "ithu saadhaaranayaayi samkhyaa feeldukalkku poojyavum string feeldukalkku shoonyamaaya string aanu". udaaharanathinu, sii + + ll ezhuthiya oru restorant bill objectinte sthirasthithi kanstraktar tipp 15 shathamaanamaayi sajjamaakkiyekkam
bill ()
 : tipp (0.15),// sathamaanam
 motham (0.0)
srishticha bill objectinte moolyam maattaan rund gattangal edukkunnu ennathaanu ithinte poraayma. pradhana prograaminullile moolyangal srishtikkunnathum mattunnathum thaazhepparayunnava kaanikkunnu
bill kaphe;
kaphe.tipp = 0.10;
kaphe.motham = 4.00;
kanstraktar overload cheiyunnathiloode, oraalkk srishtiyude paaraamettarukalaayi agravum mothavum kadannupokaan kazhiyum. ithu rund paaraamettarukalulla overload cheytha kanstraktarine kaanikkunnu. eee overload cheytha kanstraktar classilum nammal munbu upayogicha yadhaartha kanstraktarilum sthaapichirikkunnu. puthiya bill object srishtikkumbol nalkiyirikkunna paaraamettarukalude ennathe aasrayichirikkunnu (onnumilla, allengil rund):
bill (eratta tipp, eratta motham)
 : tipp (tipp),
 motham (motham)
ippol oru puthiya bill object srishtikkunna oru function kanstraktarilekku rund moolyangal kaimaran dattaa amgangale oru ghattathil sajjamakkaanum kazhiyum. thaazhepparayunnava srishtiyum moolyangalude krameekaranavum kaanikkunnu
bill kaphe (0.10,4.00);
prograaminte karyakshamatha vardhippikkunnathinum kodinte dairkhyam kuraykkunnathinum ithu upayogapradamaakum.
nirbandhitha dattaa amgangal nadappilaakkuka ennathaanu kanstraktar ovarlodinginulla mattoru kaaranam. eee saahacharyathil, purathuninnu axus cheyyaan kazhiyaathavidham sthiranirmmaathaavine svakaaryamo parirakshithamo aayi prakhyaapikkunnu (allengil sii + + 11 muthal illaathaakkaan munganana nalkunnu). oru billinu motham default illaathathinaal motham billinu mukalilulla billinu maathrame kanstraktar paaraameettar undaakoo, athesamayam tipp 0.15 aayi sthirasthithiyaakunnu.
sankeernathakal.
rund prasnangal function overloadingumaayi samvadikkukayum sankeernamaakkukayum cheiyunnu neyim masking (vyaapthi kaaranam), antharleenamaaya tharam parivartthanam.
oru paridikk oru function prakhyapikkukayum athe perilulla mattoru function aantharika paridikk mattoru function prakhyapikkukayum cheythaal, rund swaabhaavika overloading swabhaavangalundu aantharika prakhyapanam baahya prakhyaapanatthe maraykkunnu (oppu pariganikkathe), allengil aantharika prakhyapanavum baahya prakhyapanavum randum ovarlodilekku ulppeduthiyittundu, aantharika prakhyapanam oppumayi poruthappedunnuvenkil maathram baahya prakhyaapanatthe maraykkunnu. aadyathethu sii + + ll edukkunnu "sii + + ll, skoppukaliludaneelam overloading illa."thalphalamaayi, vyathyastha skoppukalil prakhyaapicha functionukalulla oru overload settu labhikkunnathin, oraal baahya vyapthiyil ninnu keywade upayogichu aantharika vyaapthiyilekku functionukal vyakthamaayi irakkumathi cheyyendathundu.
parokshamaaya tharam parivartthanam function overloadingine sankeernamaakkunnu, kaaranam paraamettarukalude tharangal ovarloducheytha functionukalilonninte oppumayi krithyamaayi poruthappedunnillengil, ennaal type parivarthanatthinu sesham poruthappedaan kazhiyumenkil, resolution eathu tharam parivarthanamaanu thiranjedukkunnathu ennathine aasrayichirikkunnu.
iva aashayakkuzhappamundaakkunna reethikalil samyojippikkaan kazhiyum udaaharanathinu, aantharika paridhiyil prakhyaapikkunna oru krithyathayillaatha poruthatthinu baahya paridhiyil prakhyaapikkunna krithyamaaya poruttham maraykkaan kazhiyum.
udaaharanathinu, adisthaana classil ninnu a edukkunna function upayogichu, c + + ll, a allengil an edukkunna overload cheytha functionulla oru deriwade klaas undengil, oraal ezhuthum
klaas bii {
 pothujanangal
 shoonyamaaya f (int i);
klaas dii public bii {
 pothujanangal
 bief upayogikkunnu;
 shoonyamaaya eph (eratta dii);
deriwade classilake pasakia oru paaraameettaril phalangal ulppeduthunnathil paraajayappedunnathu adisthaana klaasilethinekkaal erattayaakki parivartthanam cheyyukayum deriwade classile functionumaayi poruthappedukayum cheiyunnu; deriwade classile ovarloadile phalangal ulppede, angane bays classile functionumaayi poruthappedunnu.
munnariyippukal.
amithamaya ovarlodukalulla oru reethi roopakalppana cheythittundenkil, coode vaayikkunnathiloode eathu ovarlodaanu vilikkunnathennu manasilakkaan developermark budhimuttaayirikkum. overload cheytha chila paaraamettarukal saadhyamaaya mattu paaraamettarukalude (udaaharanathinu "object") paarambaryamaayi labhicha tharangalaanenkil ithu prathyekichum sathyamaan. oru aidiykk overload resolution nadatthaanum sariyaaya overload pradarshippikkaanum (allengil naavigettu cheyyaanum) kazhiyum.
type adhishtitha overloading coode attakutappanikale thadassappeduthukayum cheyyum, avide coode apdettukalkku compiler eathu reethi overload thiranjedukkunnuvennu abadhathil maattaan kazhiyum.

