We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More


Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

Graded Discussion BoardDated:Feb 07, 19

Dear Students!!!

I hope you will be fine and will enjoying studies. Please note that Graded Discussion will be launched next week on Wednesday, February 13, 2019 and it will remain open for two days (13th and 14th February, 2019). You should prepare and post your comments on below mentioned topic till the end of Thursday February 14, 2019.

Graded Discussion Topic: 

A programmer can extend the functionality and re-usability of classes using Multiple Inheritance. If it is useful in C++ then why modern object oriented languages like Java, VB.NET and C# do not support multiple Inheritance. Justify your answer with solid reasons. 

Special Note: Please note that Concise and Coherent comments will be appreciated. Lengthy comments can cause deduction in marks. 

Regards

Instructor CS304

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 733

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Replies to This Discussion

Different languages actually have different expectations for how MI works. For example, how conflicts are resolved and whether duplicate bases are merged or redundant. Before we can implement MI in the CLR, we have to do a survey of all the languages, figure out the common concepts, and decide how to express them in a language-neutral manner. We would also have to decide whether MI belongs in the CLS and what this would mean for languages that don't want this concept (presumably VB.NET, for example). Of course, that's the business we are in as a common language runtime, but we haven't got around to doing it for MI yet.
The number of places where MI is truly appropriate is actually quite small. In many cases, multiple interface inheritance can get the job done instead. In other cases, you may be able to use encapsulation and delegation. If we were to add a slightly different construct, like mixins, would that actually be more powerful?
Multiple implementation inheritance injects a lot of complexity into the implementation. This complexity impacts casting, layout, dispatch, field access, serialization, identity comparisons, verifiability, reflection, generics, and probably lots of other places.
The reasons for omitting multiple inheritance from the Java language mostly stem from the "simple, object oriented, and familiar" goal. As a simple language, Java's creators wanted a language that most developers could grasp without extensive training. To that end, they worked to make the language as similar to C++ as possible (familiar) without carrying over C++'s unnecessary complexity (simple).
In the designers' opinion, multiple inheritance causes more problems and confusion than it solves. So they cut multiple inheritance from the language (just as they cut operator overloading). The designers' extensive C++ experience taught them that multiple inheritance just wasn't worth the headache.

The problem is that the compiler/runtime cannot figure out what to do if you have a Cowboy and an Artist class, both with implementations for the draw() method, and then you try to create a new CowboyArtist type. What happens when you call the draw() method? Is someone lying dead in the street, or do you have a lovely watercolor

C# and java both doesn’t support the multiple inheritance because of the ambiguity issue. Lets take an example You have three classes A,B and C now suppose c extends the class a and b something like that
Class C extends A,B
now suppose both classes A and B have a function with the name demo(). Now if you will create the object of c class and try to call that demo function at that time compiler will get confuse weather to call demo from A or from B class. This is the reason why C# and java both doesn’t support multiple inheritance without interface.
One of the most important concepts in object-oriented programming is inheritance.It also provides an opportunity to reuse the code functionality and speeds up performance time in inheritance, the ability to create classes which inherits certain aspects from parent classes.
When we create a class, instead of writing fully new data members and member functions, the programmer can assign that the new class should inherit the members of an existing class. This existing class is called the baseclass, and the new class is referred to as the derived class.

There are couple of problems with multiple inheritance and the most obvious problem is with function overriding.

Let assume you have 2 classes A and B. both have defined function doSomething().  Now you define a third class C, which inherits from both A and B, but you don't override the doSomething() method. When the compiler seed this code...

C c = new C(); 
c.doSomething()

which implementation of the method should it use?
Without any further clarification, it's impossible for the compiler to resolve the ambiguity.
This problem is also known as Diamond Problem.

The 2nd big problem with multiple inheritance beside function over-riding is the layout of the
physical objects in memory.

For More Depth Knowledge READ This Article


Please Discuss here about this GDB.Thanks

Our main purpose here discussion not just Solution

We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions. Read More>>

Discussed & be touched with this discussion. After discussion a perfect solution will come in a result at the end.

 

“How to Join Subject Study Groups & Get Helping Material”

 

P.S:    Please always try to add the discussion in proper format title like “CS101 Assignment / GDB No 01 Solution & Discussion Due Date: ___________”

 

Share below link with friends for solution & Discussion.

http://bit.ly/vucodes

RSS

Latest Activity

zuha shah joined + M.Tariq Malik's group
2 minutes ago
+ ! ❤️ ░S░I░N░G░E░R replied to + ! ! ! ! ! ! ! ! ! ! ! ! ! ! !'s discussion 100 Instructions from the Quran
5 minutes ago
+ ! ❤️ ░S░I░N░G░E░R liked + ! ! ! ! ! ! ! ! ! ! ! ! ! ! !'s discussion 100 Instructions from the Quran
5 minutes ago
+ ! ❤️ ░S░I░N░G░E░R liked + !! "AS" !!'s discussion Jis Tarah ..
6 minutes ago
+ ! ❤️ ░S░I░N░G░E░R liked + !! "AS" !!'s discussion Baat Karna ...
6 minutes ago
+ ! ❤️ ░S░I░N░G░E░R liked + !! "AS" !!'s discussion Yaha Har Cheez ..
6 minutes ago
+ ! ❤️ ░S░I░N░G░E░R liked + !! "AS" !!'s discussion Alfaaz Ki Nisbat..
6 minutes ago
+ ! ❤️ ░S░I░N░G░E░R liked ٥ دن's discussion Gunahon ki gehrai
7 minutes ago
+ ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! replied to + "αяsαℓ " Ќąƶµяɨ •"'s discussion Happy Marriage to "Zee" & " Nomi weds Noor"....!
16 minutes ago
Qaisar nadeem replied to + M.Tariq Malik's discussion ENG201 Business and Technical English Writing Assignment No 01 Fall 2019 Solution & Discussion in the group ENG201 Business and Technical English Writing
17 minutes ago
Profile IconQaisar nadeem and Isha Chuhdary joined + M.Tariq Malik's group
17 minutes ago
+ ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! posted a discussion
29 minutes ago
+ !! "AS" !! replied to + !! "AS" !!'s discussion Jis Tarah ..
43 minutes ago
+ !! "AS" !! replied to + !! "AS" !!'s discussion Baat Karna ...
44 minutes ago
+ !! "AS" !! replied to + !! "AS" !!'s discussion Ghalti...
45 minutes ago
+ !! "AS" !! replied to + !! "AS" !!'s discussion Yaha Har Cheez ..
45 minutes ago
+ !! "AS" !! replied to + !! "AS" !!'s discussion Alfaaz Ki Nisbat..
46 minutes ago
Profile IconSafdar Mehmood, Shayaan, Hafiz muhammad sufyan and 28 more joined Virtual University of Pakistan
47 minutes ago
+ ! ! ! ! ! ! ReBeL replied to ٥ دن's discussion Gunahon ki gehrai
1 hour ago
MUHAMMAD USMAN replied to MIT's discussion cs604 Quize#1 fall semester 2019 in the group CS604 Operating Systems
1 hour ago

© 2019   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service