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 |
pls send me rrb se(s&t)questions
I am 2012 pass out b tech student(cse). i have recently started software manual testing class. Is this field is benefitial for me in future?
what is bracking strength of helbet used in mines.
How to recyling of Expired Computer/Laptop,Mouse,CPU & Key Board (Warranty)?
question no. 4======Give a brief description of the following terms: a) Play head b) Symbol c) Tweening d) ActionScript e) Frame rate f) Library panel g) Masking h) Context – sensitive Property Inspector i) Bandwidth Profiler j) Frame Label
difference between user and kernel mode?
What are the differences between 1 dimensional RAM and 2 dimensional RAM?
what are the things to be mentioned for the question "Tell me about yourself??
reverse a number ( like 1234 into 4321) using malloc in C programming
java support which type of polymorphism??runtym or compile tym or both??
hi frnds,im from andhra pradesh.i gt selected in sbi exam.my interview is on 3rd may'10.i applied under bc-e category as i belong to muslim "shaik".but nw i came to knw that it does not apply to bank exams.plz help me out.i have bc-e certificate issued by my area mro in feb'10.is this sufficient r else i had to carry other certificate..
i made lan connections ,then how can i establish the network....with that connections only is the network is established ...tell me the procedure for giving the lan connection for some(10) pc's?