what is the term genericity in oops?
Answer / 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 |
what are the differences between one dimensional ram and two dimensional ram?
A polynomials in mamory can be represented by____________
could i know the selection pattern at hpcl, am an undergradute in chemical technology, but my sujects or course do not figure out antwhere on the lists.
what are the differences between structures and arrays in c language?
How would Nvidia increase the core clock speed anymore?
What is the procedure for taking leave while detecting Epf and Esi?
Guys! I coplted 10th with 80% and +2 with 64% now am dng c.s.e b.tech...i want to go abroad for higher studies i want to write tofel...plZ GIVE UR SUGGESTIONS!
write a pgm to accept an array of names & name & check whether the name is present in the array. return the count of occurance. use following array as input; {"Dave","Ann","dev","merry"}
what is the maximum load for MDB, SMDB & DB
which is better php,asp.net,jsp? and why?
Please if anybody have Vizag Steel Entrance exam papers or atleast Pattern of exam.Then please forward to my email- id: :srikanth.avanthi@gmail.com
defference between menu and context menu in vb.net?