QueryCAT Logo
Search 5,000,000+ questions and answers.

Frequently Asked Questions

Why doesn't C# have multiple inheritance?

FAQ for the microsoft.public.languages.csharp newsgroup
C# (and .NET in general) has multiple inheritance of interface (meaning that you can implement many interfaces in a type) but only single inheritance of implementation (meaning that you can only derive a class from one other class - which may, itself derive from another, etc). (I'll get round to the actual reasoning behind this sooner or later...)

Why does C++ need inheritance ?

C++ corner
Inheritance is a very strong C++ mechanism to help build a class hierarchy and express, through code, relationships between classes. Perhaps the most used example is the Shape hierarchy design. Consider you want to build a simple Paint program. You would probably want to have a generic Shape class and have Circle, Triangle and Polygon inherit from it. See similar questions...

How to handle C++ inheritance in Ch?

Frequently Asked Questions for Ch
Ch itself doesn't support inheritance. However, you can modify C++ to work in both Ch and C++. For example, for the C++ code below: class base { public: int get_base_i(); void set_base_i(int i); virtual void mybase(); private: int base_i; } class super:base{ public: int super(); virtual void mybase(); } You can create an equivalent Ch class called super listed below. See similar questions...

Is multiple inheritance of class supported ?

FAQ about language spec of MixJuice
We think multiple inheritance of class is a necessary function for object-oriented languages. However, as far as MixJuice is a language executed on the JavaVM, there is no plan to support it. If one implements a multiple inheritance of class mechanism on the JavaVM, there is no way to avoid slow execution speed. See similar questions...

When shall I use Multiple Inheritance?

OOPS FAQ - Page 3
Latest Answer: Whenever u want to derieve a class having multiple ancestors or base calsses u have use Multiple Inh... See similar questions...

What are some disciplines for using multiple inheritance?

Inheritance -- multiple and virtual inheritance, C++ FAQ Lit...
M.I. rule of thumb #1: Use inheritance only if doing so will remove if / switch statements from the caller code. Rationale: this steers people away from "gratuitous" inheritance (either of the single or multiple variety), which is often a good thing. There are a few times when you'll use inheritance without dynamic binding, but beware: if you do that a lot, you may have been infected with wrong thinking. In particular, inheritance is not for code-reuse. See similar questions...

How to handle C++ class inheritance in Ch?

Frequently Asked Questions for Ch
To disable trigraphs in Ch, add _ignoretrigraph = 1; in startup file _chrc or .chrc in the user's home directory or add #pragma exec _ignoretrigraph = 1 inside a script to ignore trigraphs. There are two ways to run multiple statement Ch shell. You can add { } to form a compound statement with multiple single statements as shown below. > {int x=0;while(x<10){x++;printf(x);}} Alternatively, type in multiple single statements in multiple lines, one at a time. See similar questions...

Does GTK+ have multiple inheritance?

Frequently Asked Questions
No, but "interfaces" (in Java terms) or "pure virtual classes" (in C++ terms) are planned for the next version. See the section called Overridable Signals in the chapter called Writing a GtkWidget for a discussion of an ugly workaround used in GtkWidget to create "activatable" and "scrollable" interfaces. See similar questions...

When should you use multiple inheritance?

Ans: There are three acceptable answers:- "Never," "Rarely," and "When the problem domain cannot be accurately modeled any other way." Consider an Asset class, Building class, Vehicle class, and CompanyCar class. All company cars are vehicles. Some company cars are assets because the organizations own them. Others might be leased. Not all assets are vehicles. Money accounts are assets. Real estate holdings are assets. Some real estate holdings are buildings. Not all buildings are assets. See similar questions...

How do you do multiple inheritance in Ada 9X?

Ada FAQ: Programming with Ada
That document describes several mechanisms for achieving MI in Ada. It is not unusual, however, to find complaints about the syntax and the perceived burden it places on the developer. This is what Tucker Taft had to say when responging to such a criticism on comp.lang.ada: Coming up with a syntax for multiple inheritance was not the challenge. See similar questions...

So there are times when multiple inheritance isn't bad?!??

Inheritance -- multiple and virtual inheritance, C++ FAQ Lit...
You won't use it all the time. You might not even use it regularly. But there are some situations where a solution with multiple inheritance is cheaper to build, debug, test, optimize, and maintain than a solution without multiple inheritance. If multiple inheritance cuts your costs, improves your schedule, reduces your risk, and performs well, then please use it. On the other hand, just because it's there doesn't mean you should use it. Like any tool, use the right tool for the job. See similar questions...

What is the mode of inheritance?

Imagemap
In Newfoundlands and Labrador Retrievers, cystinuria is an autosomal recessive trait. In other breeds, the mode of inheritance is unknown, and in most breeds does not appear to be autosomal recessive. Research is ongoing at the University of Pennsylvania to discover the mode of inheritance in, and develop genetic tests for, cystinuria in other breeds. More info here. See similar questions...

Can I build a base control class and use C++ inheritance to derive other controls?

ActiveX Control FAQ - General
Yes, it can be done and is fairly easy. The tricky part involves setting up the MFC-based macros that are used by AppWizard and ClassWizard. When deriving from the base class you have to cut-and-paste to build the ODL file properly, use specific base-class DISPIDs, etc. All of this is explained in detail in Microsoft Knowledgebase article Q138411. An example is also provided (SHAPES2.EXE) that illustrates the techniques. See similar questions...

Is there a good way of simulating OOP-style inheritance, or other OOP features, in C?

Structures, Unions, and Enumerations
It's straightforward to implement simple ''methods'' by placing function pointers in structures. You can make various clumsy, brute-force attempts at inheritance using the preprocessor or by having structures contain ''base types'' as initial subsets, but it won't be perfect. There's obviously no operator overloading, and overriding (i.e. of ''methods'' in ''derived classes'') would have to be done by hand. It's not clear if it's legal or portable, but it is rather popular. See similar questions...

Can I avoid name collisions brought by multiple inheritance by "rename" ?

FAQ about language spec of MixJuice
I appreciate the division of module from class, but you should divide inheritance of implementation and inheritance of interface (i.e. subtyping) also. See similar questions...

It isn't preferable to have possibility of multiple inheritance of modules, is it ?

FAQ about language spec of MixJuice
Among problems of multiple inheritance, name collision problem has been solved completely by introducing fully qualified names of fields and methods. Another problem, or semantical collision can be solved by applying the ideas of Design by Contract and Behavioral Subtyping to difference-based modules. (See this paper for more details.) However, it is certain that for human beings tree structures are easier to handle than general graph structures. See similar questions...

I've been told that I should never use multiple inheritance. Is that right?

Inheritance -- multiple and virtual inheritance, C++ FAQ Lit...
It really bothers me when people think they know what's best for your problem even though they've never seen your problem!! How can anybody possibly know that multiple inheritance won't help you accomplish your goals without knowing your goals?!?!?!?!!! Next time somebody tells you that you should never use multiple inheritance, look them straight in the eye and say, "One size does not fit all. See similar questions...

Explore Other Topics

How will I know the balance on my EBT card?
What States are shown on the back of the five-dollar bill?
How can I get a restraining order?
Is the mold growing on my bathroom ceiling toxic?
Which ETHEX Prenatal Vitamins contain stool softeners?
raquo; What are the effects of using cannabis and breastfeeding? How does this affect the child?
Just how good are the coatings and paint finish used on metal roofing panels?
Can I get a static or dedicated IP address?
Q: Is frequent urination normal after a radical prostatectomy?
How can I tell if I'm using the correct SpeakonŽ cable?
What is the difference between my dial-up and satellite broadband?
More Questions >>

© Copyright 2007-2012 QueryCAT
About • Webmasters • Contact