Why java doesnot support MultipleInheritance

Hi,
What is the disadvantage when a derived class extends two base classes (ie)
multiple inheritance. Where C++ uses it effectively. Is there any reason why java does not support that & uses interface for that???
Pls. do provide the answer...
Thanks,
M.Ananthu

What is the disadvantage when a derived class
lass extends two base classes (ie)
multiple inheritance. Where C++ uses iteffectively.
Is there any reason why java does not support that&
uses interface for that???No. It's a bug.I don't think I would call it a bug. It's a direct consequence of the original design, becuase of the inclusion of the Primordial class (java.lang.Object).
Let's say you inheritted from Integer and String. Then you would be inheritting Object twice, once from Integer and once from String. Then, which one would you use to get the hash code? which one to get the toString? the clone?
Whether or not it should be a feature of java has been in debate since java was created, but it certainly wasn't a bug. I believe it was deliberately not supported (although i acknowledge that I'm by no means the expert).
- Adam

Similar Messages

  • Why Java Web Start doesn't support Pack200 out-of-the-box?

    Hello All,
    Why Java Web Start doesn't support Pack200 out-of-the-box? I was hoping that Java 6 would make things easier by adding direct support for Pack200 in Java Web Start and JNLP without needing to use servlets, etc.? All my clients are Java 5 or above so I can't push the Pack200 compressed version of the jar to every single one of them and there is no selection process needed. But I can't do it because of the servlet or complex Apache server setup requirement (it would be a headache to get customers' web server admins to set up Apache or whatever web server that way).
    My question is why is there unwillingness to add Pack200 support directly to Java Web Start and JNLP so that you can start Pack200 compressed jars just like you would start any jar using Java Web Start? Is te a technical problem?
    Thank you,
    Mete Kural

    Hallo,
    I didn�t try it, but the webstart FAQ�s read:
    Can I use Pack200 compression with the JnlpDownloadServlet?
    Yes. The JnlpDownloadServlet distributed in the samples directory of the JDK now supports Pack200. If you deploy yourfile.jar along with yourfile.jar.pack.gz the packed file will be downloaded when the client is running Java Web Start 1.5.0 or later.
    http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/faq.html#217
    For further information you may want to look at
    http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/downloadservletguide.html#pack200
    The configuration of the server and the the servlet (as described in the second link) is as easy as it seems.
    I got it working on the first try and it was my first experience with websevers at all.
    Bye Schippe
    Message was edited by:
    Schippe

  • Why java does not support multiple inheritance ???

    Hai friends ..iam new to java .. i have doubt ..plz help me
    Why java does not support multiple inheritance ???

    The reasons for omitting multiple inheritance from the Java language mostly stem from the "simple, object oriented, and familiar" goal.
    To understand multiple inheritance, the learner needs some level of expertise like virtual derivations etc in c++. Multiple inheritance will allow method duplication, and throws the learner into confusion which method might be called by the compiler in which scenario at run time.
    Even though this answer seems to be funny, this is the actual reason why java omitted multiple inheritance of classes.
    But java support multiple inheritance of interfaces. Multiple interface inheritance allows an object to inherit many different method signatures with the caveat that the inheriting object must implement those inherited methods.

  • Why java is called pure object oriented.

    i know that java is called as pure object oriented language.
    why it is called so even though it has primitive datatypes and also it doesnot support multiple inheritance completely. it only supports in the case of interfaces but not in the case of classes. then why it is called pure object oriented.

    Its because you cannot write an executable java program without creating an object. Well, you can:
    public class a
      public static void main( String a[] )
    }In contrary to C++, there can be no variables or functions in the wild (outside a class).
    You can not create an executable java program without creating a class (but not forcibly its instance, an object.)
    The "pure object oriented" wording in this sense has not really much importance, it is rather a marketing ploy.

  • Why java only can display GIF file not jpeg and BMP ??

    Did anyone know why java only can display GIF file not in jpeg and BMP ?? This is because the quality of GIS is not as good as Jpeg and BMP
    any code to load the display process ??
    thx guys !!!

    you can do jpegs but im not sure about bmps.
    The only thing ive noticed is that java cant support transparent jpegs, only transparent gifs
    Jim

  • Why Java is  following Unicode & not ASCII standard?

    Hi all,
    I am new to Java as well as to this forum.
    Could you please tell me why Java is not following ASCII format?
    And why is it following Unicode?
    Thanks,
    Reni

    Unicode is chosen because it's an abbreviation for Unique Ode, which means that it provides a special sort of poetry to give Java an aura of mystique, intelligence and worldliness that sets it apart from other languages.
    To support languages and characters other than English.Who doesn't read/speak English, really?! And why isn't there multiple language keywords for Java. Why can't I write code en Espa?ol?
    p?blico vac?o hagaAlgo(Secuencia s) {
       para(nent i = 0; i < s.longitud(); i++) {
          Sistema.fuera.impresi?nL?nea(i + " = " + s.car?cterEn(i));
    }(int abreviated for "n?mero entero")
    Message was edited by:
    bsampieri

  • Why java is called as true object oriented language?

    HI Friends,
    Though few oops concepts is not supported , why java is called as truly object oriented language and C++ as not a purely object oriented language???? Please, if any one know , give me the answer.
    Thanks to all.

    few oops concepts is not supportedwhich concepts?
    as far as i know...to be OO, you must supports
    encapsulation, abstraction, inheritancxe, composition (aggretration, et all) and polymorphism. Java supports all those comcept..now..Java is a hybrid due to what Jverd has pointed out.
    the only pure OO language that i know of is SmallTalk. they have Meta class that can create Class object. and all their primitaives are object.
    C# comes close, but their Class are not object.

  • Why Java doesn't allow to reduce the accessibility of a method du

    Why Java compiler does not allow to reduce the accessibility of a method during inheritance?
    ( Eg; If the base class has a public method and if that method is overridden in child class but
    with defuault access, it gives compile error)
    Supposed answer:
    Because in the runtime, it cannot check the access modifier.
    Suppose A is the base class. It has a method fun() as public.
    B is the derived class of A.
    Suppose in some other class (say C) there is a method myFun() which takes A as parameter and
    calls the fun() method of A. So that method can take B
    also as parameter (As it is derived from A).
    So if the fun() method's accessibility is reduced in B, whether "that can
    be called in C or not" is not known. that is why compiler does not
    allow the reduce the accessibility of a method during inheritance.
    Member variables do not have this problem as they can be checked at
    compile time.
    Is this explanation correct?

    You can give private access, sort of... you could fake it, if the goal is to prevent someone from doing what the method does. Of course, they could (as long as A isn't abstract) create their own A and do whatever they want.
    class A {
       public void doThis() {
    class B extends A {
       public void doThis() {
          // explicitly do nothing
    }But I think generally, this shouldn't be a problem. I'm not sure if it's something that is common for creating an API to subclass another class to hide the superclass's methods. Usually you are adding functionality to a subclass that is for more specific things then the superclass supports. I mention creating an API because if it's just for some application class, then you are writing it, so use or not use the methods as you want. It's APIs for library type classes that other people would use, and if you are extending the library, and really need people not to call methods for some reason, document it. Maybe a good place for an assertion?

  • ACR 8.7 has been released with support for the Nkon D750.  Why no Lightroom support yet?

    ACR 8.7 has been released with support for the Nkon D750.  Why no Lightroom support yet? Am I wrong or was support for the D810 available far more quickly?

    ACR 8.7 has not yet been released. The ACR 8.7RC has been released. It is a Release Candidate - and as such, is not a final version.  I wouldn't be concerned about a lack of Lightroom support until a final version is released.
    Adobe Photoshop Camera Raw 8.7 Release Candidate | digital camera raw file support - Adobe Labs

  • Why java file name and class name are equal

    could u explain why java file name and class name are equal in java

    The relevant section of the JLS (?7.6):
    When packages are stored in a file system (?7.2.1), the host system may choose to enforce the restriction that it is a compile-time error if a type is not found in a file under a name composed of the type name plus an extension (such as .java or .jav) if either of the following is true:
    * The type is referred to by code in other compilation units of the package in which the type is declared.
    * The type is declared public (and therefore is potentially accessible from code in other packages).
    This restriction implies that there must be at most one such type per compilation unit. This restriction makes it easy for a compiler for the Java programming language or an implementation of the Java virtual machine to find a named class within a package; for example, the source code for a public type wet.sprocket.Toad would be found in a file Toad.java in the directory wet/sprocket, and the corresponding object code would be found in the file Toad.class in the same directory.
    When packages are stored in a database (?7.2.2), the host system must not impose such restrictions. In practice, many programmers choose to put each class or interface type in its own compilation unit, whether or not it is public or is referred to by code in other compilation units.

  • HT4972 hello friends i have a problem in my ipod touch it has 4.2.1 version of software but it doesnot supports any aps so how to update the ios please anybody help me..

    hello friends i have a problem in my ipod touch 3g it has 4.2.1 version of software but it doesnot supports any apps so how to update the ios 5 or more than this please anybody help me..i am in trouble.

    I suspect you really have a 2G iPod. Those can only go to iOS 4.2.1.
    Identifying iPod models
    iPod touch (3rd generation)
    iPod touch (3rd generation) features a 3.5-inch (diagonal) widescreen multi-touch display and 32 GB or 64 GB flash drive. You can browse the web with Safari and watch YouTube videos with Wi-Fi. You can also search, preview, and buy songs from the iTunes Wi-Fi Music Store on iPod touch.
    The iPod touch (3rd generation) can be distinguished from iPod touch (2nd generation) by looking at the back of the device. In the text below the engraving, look for the model number. iPod touch (2nd generation) is model A1288, and iPod touch (3rd generation) is model A1318.
    Otherwise connect to yor computer and update via iTunes. Yo need iTunes 10 or later on the computer.
    To more easily find compatilbe apps for 4.2.1
    iOSSearch - search the iTunes store for compatible apps.
    Vintapps 3.1.3 - paid app.
    Apple Club - filter apps by iOS version.
    Discussion post by msgarmar - technique to sort apps by date.

  • Why is the support service for Adobe CC so bad?

    ...after more than 2 hours on the phone, giving up on a reply from web chat and seeing no response to my question on these discussions...I am asking why is the support service for Adobe CC so bad?

    Hi Sean,
    I am sincerely sorry to hear you are having trouble with our customer support.
    Please, allow me to get in touch with you by email.
    Thank you.
    Arnaud.

  • Why is the support so bad and expensive?

    Putting in my serial number of a product that is now useless tells me I'm not covered by the support so I have to pay £25 to have someone call me.
    When I put in all my details so I can phone Apple myself I then get given a premium rate number to phone and when I get through I start getting asked the same questiuons I answered online ( to get my case number ) so the call is going to end up costing more than it should. The case number is supposed to make the call quicker.
    Why is help so expensive here?
    Why can't I just email support?

    John Galt, the poster already did that as he said in this discussion. He said:
    I'm sure with the millions of dollars Apple make every day they can pay staff for support. Instead of that they create a forum where people can do their work for them for free.
    I've posted details about my problem herehttps://discussions.apple.com/message/25581520#25581520
    John Galt wrote:
    Post details of your own problem by starting your own Discussion, not by replying to someone else's. That is the best way to exploit the free resources of this free website.
    Otherwise, your only question "why is the support so bad and expensive" stands. It has been answered in this Discussion, which will effectively close it for those willing to help.

  • Why is Oracle support of such incredibly poor quality?

    A previous thread which was "LOCKED" because some one could not accept the feedback read:
    "Oracle make billions of dollars each year, but their quality of support just seems to get worse and worse.
    Why is Oracle Support so bad and how can we pressure Oracle to improve their service?
    Is this just my experience?"
    My answers and suggestions are:
    Oracle make billions of dollars each year, but their quality of support just seems to get worse and worse.
    I agree
    Why is Oracle Support so bad
    because the feel they can get away with it. So far, it is working.
    How can we pressure Oracle to improve their service?
    Probably the only way is to use other database software wherever and whenever possible. Competition is increasing in the database space, there are options for many database applications.
    Is this just my experience?
    I don't think so. It is becoming common knowledge in the industry that Oracle has very poor support. Oracle is becoming the CA of the 21st Century

    On the other hand, I elsewhere answered a similar assertion recently with:
    http://groups.google.com/group/comp.databases.oracle/browse_thread/thread/fa9b4753bdced0ad/b02e32cde9390b6d?
    http://groups.google.com/group/comp.databases.oracle/browse_thread/thread/a697e3130020283e/70e209cfaa01b2c2?
    ...My experience has been there are good groups and crappy groups in
    Oracle support, and periodically they revamp everything to squish the
    balloon around. Then we have to figure out how to work the system
    again, whether it is figuring out what time of day to call or what
    magic words to say...
    Note the dates in the linked posts.

  • Why java is called java2

    why java is called java2 and another thing that i would like to know is why it was renamed to java from its previous name OAK
    Thanx
    Manish

    why java is called java2Not to sure about this one, but I think it was a marketing decision - I guess 'Welcome to the Java 2 platform' sounds better than saying 'Welcome to the JDK 1.2.1 platform' :=)
    and another thing that i
    would like to know is why it was renamed to java from
    its previous name OAKThere was already a patented product named 'OAK', so they had to rename it to something else to avoid the law.
    >
    Thanx
    ManishA brief history of Java:
    http://java.sun.com/features/1998/05/birthday.html
    http://www.ils.unc.edu/blaze/java/javahist.html

Maybe you are looking for