What are generic functions and generic classes?
Answers were Sorted based on User's Feedback
Answer / draku
Generic functions are functions which are not used for any
particular datatype..they are useful for anydatatype Ex: if
you write code for the Sorting program using templates then
the function is useful for any data type to sort...Generic
classes are same as generic functions
Is This Answer Correct ? | 41 Yes | 5 No |
Answer / nikhil kapoor..
Generic functions are the function which return void ptr...
(void*)...
Generic Classes are template classes...
Basicaly we implement both of them for reusability.. and
abstraction..
Is This Answer Correct ? | 28 Yes | 3 No |
Answer / saranya.c
Generic functions are functions which are not used for any
particular datatype..they are useful for anydatatype Ex: if
you write code for the Sorting program using templates then
the function is useful for any data type to sort...Generic
classes are same as generic functions
Is This Answer Correct ? | 9 Yes | 6 No |
Answer / lokesh singh
when ever we think about generic function, first of all
think why we needed.
if we want to use no of diffrent-diffrent variables in a
programme then we need no of function for that purpose.
generic function is used for preventing function
overloading. due to feature of taking any type of variable.
it have such type of quality.
Is This Answer Correct ? | 8 Yes | 5 No |
Answer / sahadev
its happen in Tamplate. if a function receive any type of
argument than its called generic function.
Is This Answer Correct ? | 7 Yes | 6 No |
What is the difference between class and structure?
What is the main purpose of inheritance law?
What do you mean by variable?
What is the difference between encapsulation and polymorphism?
Is following functions are said to be overloaded? int add(int a,int b) char *add(int a,int b)
write a programe to calculate the simple intrest and compund intrest using by function overlading
What do we mean by a hidden argument in C++?
is java purely oop Language?
49 Answers HCL, Infosys, TCS,
Why is encapsulation used?
What is and I oop mean?
Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.
What is the difference between inheritance and polymorphism?