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 in 4th and 5th normal form ??
Please mail me the sample papers of PNB for the post Dy. Manager.
there are 50 users in a network, one system is virus affected , how to find that virus affected system?
what two ways you can use to ensure that visual basic does not allow uncleared variables?
How to calculte strengh of scaffoling(indian)
why does the array will be start on size 0?
WHAT IS THE MEANING OF FLASHING VD AND FD INSTALLATION PLENIUM BOXES IN CENTRAL AIR CONDITION
Write a test case plan for a typical banking application which involves functionalities like Balance enquiry, deposit, fund transfer etc. Make your assumptions and mention the same in your answer sheet.
what is memory interface????
hai...i need the interview questions of php...its very urgent
How is the parity flag actually set in the 8085 microprocessor?
Hi I am Krushna.I have already applied for PO post in Syndicate Bank.Can anybody send me the sample paper for Syndicate bank PO.
Civil Engineering (5086)
Mechanical Engineering (4456)
Electrical Engineering (16639)
Electronics Communications (3918)
Chemical Engineering (1095)
Aeronautical Engineering (239)
Bio Engineering (96)
Metallurgy (361)
Industrial Engineering (259)
Instrumentation (3014)
Automobile Engineering (332)
Mechatronics Engineering (97)
Marine Engineering (124)
Power Plant Engineering (172)
Textile Engineering (575)
Production Engineering (25)
Satellite Systems Engineering (106)
Engineering AllOther (1379)