Answer Posted / akshata
Abstraction of structure independently of type is genericity
(pronounced jen-err-iss-it-ee).
E.g. Compare these two functions to return the maximum of
two numbers.
integer maxInteger (integer param1, integer param2)
{
if (param1 > param2)
{ return param1; }
return param2;
}
float maxFloat (float param1, float param2)
{
if (param1 > param2)
{ return param1; }
return param2;
}
It seems silly to have to write the two functions but if a
language doesn't allow you to pass an integer to a function
that requires a floating point parameter (or vice versa)
then this is exactly what you must do.
Some languages allow you to to write a single generic
function that will serve the same purpose for both integers
and floating point values (or any other types you like for
that matter). In general, such a function might look a
little like this.
TYPE max (TYPE param1, TYPE param2)
{
if (param1 > param2)
{ return param1; }
return param2;
}
Is This Answer Correct ? | 7 Yes | 1 No |
Post New Answer View All Answers
why does the array will be start on size 0?
List three things you can do with the files you create by recording your voice on your computer
hi friends, i got selected in tcs, i m doing my b.e in one of the college in coimbatore.. i don have questions to post u.. but i have valid suggestion..its waste to prepare apti for tcs by looking at last 10 year question from internet.they changed all the apti question this year(2009).. but apti questions is easy..prepare critical reasoning for gre 12th edition..mug up the answers in critical reasoning.. u can download ebook for gre 12th edition..solve the critical reasoing question at the same time mug up it.. there were totally 3 critical reasoning question asked.. two for gre 12th edition so if u mug up u can finish two questions in 3 min.. so u will have 27 min for other question so u can work it out and find the ans..above i mentioned as 3 questions tat is 3 question means ,three paargraph.. each para carries 4 question so totally 12 question in critical reasoning.. if u clear all 12 question u will be selected.80% percent sure.then don mug up synonyms from gre barron because they are asking same question from barron but the choice for the questions are changed.. so study synonyms and antonyms from internet.. some pupils have posted the questions.. in tech and h r don use complex word or don show tat u r so dminant.. talk with them how u will speak wit ur friend. u will be through.. don think wat i have posted above is lik some info in other site.. wat i said is true.. they changed apti tis time.. u will be selected if u follow wat i said..again i m saying pls concentrate on critical reasoning.. if all questions in it are right u r through..bye
when did actually oil exploration start
If memory is allocated to a class,when object of the class is created then how do we use the abstract class methods.coz v cant create obj of abstract class, only reference is created,when the abstract class data and members got the space in memory??
what is domain functional level in windows server 2003?
I have completed my B.E with (CSE) computer science and engineering ,i had a total no of backlogs=20 ,is there any chances to get the visa PLEASE HELP ME NE1 : MY ID=john_searchig143@yahoo.com .
synchronous and asynchronous transmission
verbal quiz and answers
what is rapid application development
how the parting surface is selected in injection mould
Box 1 cotain odd value X or Y the box 2 =X i.e 7 or 12 box 3= Y has value 19 if X is 7 or 31 if x is 12 get even value X or Y Use any operator steps allowed 3.
what are the main points to be included in our introduction when asked in hr...??
write a progremme using function 0f prime no.?
hi ,,,,I m going to attend corporate bank exam of specialist IT officer, I don't Know What type of question arise in interview..some suggest me my email id is surinder.singh.btech@gmail.com