In what sense is ambiguity an essential component of object-oriented programming? Think in the context of virtual functions, pure virtual functions, and dynamic binding.
Answer:-
what sense is ambiguity an essential component of object-oriented programming? :-
Ambiguity : A situation in which something has more than one possible meaning and may therefore cause confusion.
Now, In case of multiple inheritance, a single class is derived from two or more parent (base) classes. So, there may be a possibility that two or more parents have a member function with the same name. If the object of derived class needs to access one of the same named member function from the base class, then it results in ambiguity. The compiler is confused as method of which base class method to invoke on executing the call statement.
That is when you have a derived class, and a base class, that both have members with the same name. If you attempt to access that “name”, in the derived class, it is ambiguous if you are referring to the name in the derived class, or the base class. You can address this by either changing the name, or specifically referring to the class when addressing the member.
I would also call a lot of operator overloading ambiguous as well. However, that is better suited to a different question. ;)
on the contxt of
virtual functions:-
In object-oriented programming, in languages such as C++, and Object Pascal, a virtual function or virtual method is an inheritable and overridable function or method for which dynamic dispatch is facilitated. This concept is an important part of the polymorphism portion of object-oriented programming
pure virtual functions:-
A pure virtual function or pure virtual method is avirtual function that is required to be implemented by a derived class if the derived class is not abstract. Classes containing pure virtual methods are termed "abstract" and they cannot be instantiated directly
Dynamic binding
Dynamic binding also called dynamic dispatch is the process of linking procedure call to a specific sequence of code (method) at run-time. It means that the code to be executed for a specific procedure call is not known until run-time. Dynamic binding is also known as late binding or run-time binding.
In what sense is ambiguity an essential component of object-oriented programming? Think in the context of...
1. How does polymorphism contribute to the design of object-oriented systems? 2. Explain the role of the vptr and vtable in the implementation of virtual functions. 3. What is a pure virtual function and why would you ever use one? 4. What is the purpose of a virtual destructor? 5. Describe a situation where it makes sense for a class to have a destructor, but no constructor.
Many programmers think that object-oriented programming is a superior approach to procedural programming. Others think it adds a level of complexity that is not needed in many scenarios. Find and summarize arguments on both sides of this issue. With which side do you agree? Why? Be thorough and detailed with your answers. Write at least two FULL PARAGRAPHS and be sure to CITE your sources (using MLA or APA format). "Summarize" here means to state in your own words--do not copy and paste the words of others. You must...
What are constructors? Explain why they are needed in an object-oriented programming language. If inheritance takes place, what is the order in which the parent and child constructors are called? Can a constructor be overloaded? Can a constructor be overridden? Explain when a destructor should be declared as virtual in C+? Explain the use of the access specifiers public, protected and private in C++. Which is the default specifier?
The characteristic of object oriented programming that allows the method in subclass that overrides the same method in the superclass to be correctly called from an instance of that superclass is called A. abstractness B. polymorphism C. data binding D. inheritance
What is object oriented programming? please give introduction, explanation and conclusion.
What is polymorphism in Object-oriented programming? Write down C# code example support the polymorphism
Please reflect what you have learned in this class on the following topics: - Object-Oriented programming - SQL - File - Network WebServices
What are the differences between the traditional program paradigm (procedural programming) and the newer object oriented paradigm? What are the advantages and disadvantages of each? Which paradigm would you prefer to work with? Explain and give your reasons.
What are the benefits and disadvantages of object-oriented programming? What is the difference between a flat-file database and a relational database? In what situations is it more appropriate to a flat-file database over a relational database, and vice versa? What are the advantages to using cookies to power a web application? Are there any risks involved using cookies?
In object-oriented programming, the object encapsulates both the data and the functions that operate on the data. True False Flag this Question Question 101 pts You must declare all data members of a class before you declare member functions. True False Flag this Question Question 111 pts You must use the private access specification for all data members of a class. True False Flag this Question Question 121 pts A private member function is useful for tasks that are internal...