--
1-What is Static Polymorphism? Write its alternative name with a simple example.
Sol,
IDEA 1:
Static polymorphism refers to an entity existing in different physical forms simultaneously. Static polymorphism involves binding of functions based on the number, type, and sequence of arguments. The various types of parameters are specified in the function declaration, and therefore the function can be bound to calls at compile time. This form of association is called early binding. The term early binding stems from the fact that when the program is executed, the calls are already bound to the appropriate functions.
The resolution of a function call is based on number, type, and sequence of arguments declared for each form of the function. Consider the following function declaration:
void add(int , int);
void add(float, float);
When the add() function is invoked, the parameters passed to it will determine which version of the function will be executed. This resolution is done at compile time.
IDEA 2:
Static polymorphism is obtained by creating function or class templates. If a class can be thought of as a mold for an object, a class template can be thought of as being a mold for a class, which is then used to create an object. Creating and using class and function templates is a good way to write reusable source code - as long as it's done right.
In this article I will show you how to declare and implement a template class and its methods. I'll use a fairly extensive example so you can get a feel for the power designing with template classes and static polymorphism has to offer.
2-What is Dynamic Polymorphism? Write its alternative name with a simple example
Sol,
Dynamic polymorphism is obtained through the use of abstract base classes, base class pointers and virtual function calls. Designers cast their application architecture in terms of abstract classes and the interfaces they provide and then substitute derived class object addresses where base class object addresses are expected. Virtual function calls are resolved with the aid of a virtual function table.
3- What is the main difference between Data Hiding and Data Abstraction? How we achieve it in Inheritance? (Be specific: don’t write detailed theory: give it in your own words after study
Sol,
Data Abstraction:
Data Abstraction increases the power of programming language by creating user defined data types. Data Abstraction also represents the needed information in the program without presenting the details.
Data abstraction is the process of refining data to its essential form.
Data abstraction is the process of refining data to its essential form.
Data hiding:
Data hiding is a property when the internal data structure of an object is hidden from the rest of the program
****************************************************************************************
You received this message because you are subscribed to the Google
Groups "vuZs" group.
**
To join this group visit http://groups.google.com/group/vuZs/subscribe?hl=en
**
To post a new message on this group, send email to vu...@googlegroups.com
**
Posting Rule: Please Start your subject line with subject code (like MGT501, MGT402)
**
For old Papers, online Quizzes, Assignments, visit
==> vuzs.net
**
To unsubscribe from this group, send email to
vuZs+uns...@googlegroups.com
**
For more options, visit this group at
http://groups.google.com/group/vuZs