ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
Why java Don't Support Multiple interitence
 Question Submitted By :: Manishjavaguru
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Why java Don't Support Multiple interitence
Answer
# 1
Multiple Inheritance is not supported by java in order to
avoid ambiguity between variables of different classes and
to rudece memory overloading.
 
Is This Answer Correct ?    19 Yes 1 No
G Ch Vishnu Vardhan Reddy
 
  Re: Why java Don't Support Multiple interitence
Answer
# 2
There is a big reason behind that(java does not support 
multiple inheritance). Please go through the following 
example.

1. Assume that java is supporting multiple inheritance 

class A {

  void m1() {
        // implement method 
  }
}

class B {
  void m1() {
        // implement method
  }
}
//As for the assumption (1) the following code will compile

class C extends A,B {

   public static void main( String s[]) {
   
     C c = new C();
     c.m1();
   }
}

Note : In main method i am calling c.m1() method In this 
situation which super class m1 method has to call (from A 
or B) JVM will confuse.

So our assumtion(1) is wrong .

This is the  reason why java does not support multple 
inheritance through classes.

Note : This same cocept is applicable for classes.
 
Is This Answer Correct ?    11 Yes 1 No
Bhaskar Reddy
 
 
 
  Re: Why java Don't Support Multiple interitence
Answer
# 3
ya java don't support multiple interitence but by achieving
it the interface are came
 
Is This Answer Correct ?    1 Yes 2 No
Kiranksj
 
  Re: Why java Don't Support Multiple interitence
Answer
# 4
The famous "diamond shaped problem " is the reason behind NOT using multiple inheritance in java.
   check out this link for full details
       http://en.wikipedia.org/wiki/Diamond_problem
 
Is This Answer Correct ?    0 Yes 1 No
Sid
 
  Re: Why java Don't Support Multiple interitence
Answer
# 5
java support multiple inheritance not through the use of
class, but through the implementation of interface we can
achieve multiple inheritance.

By using interface we can implement multiple interfaces for
a class which can solve the problem of our multiple inheritance.
 
Is This Answer Correct ?    0 Yes 1 No
Samir Rana
 
  Re: Why java Don't Support Multiple interitence
Answer
# 6
Java Does not support Multiple inhertiance through class
because ambiguity between variables  of different classes
and to rudece memory overloading.and another reason java 
extended only one class at time

java support Multiple inhertiance through interfaces.because
java class implements any number of interface at  time
 
Is This Answer Correct ?    0 Yes 0 No
Srinu
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
What are uses of Hash Code? Cognizent2
what are class,constructor and primitive data types?  2
when i write string s1="java"; in one program(application) and string s2="java"; in another application on the same jvm will both objects s2,s2 will refer to same memory location where "java" is stored in string pool.  2
Hi Friends, can u give me Real Time example for interface and abstract class.(With Banking Example)  1
what is bytecode ?explain in detail and watz the difference between bytecode and machine code? Lucent3
what is diffrence between .NET and java?  2
write the hierarchy of component class?  1
what is a static block?  4
What is an exception?  4
What is the default modifier in Interface?  4
what is multithreading? Virtusa4
What is "Java Native Interface" and how to use it? IBM1
question on Thread synchronization Huawei1
What is the need to implement Serializable interface (with no methods) for objects which are to be serialized ? We can write our own functionality which writes objects to streams then why we need to implement and tell JVM that which objects can be serialized. iFlex4
Functionality of JVM? Infosys4
How multipleInheritance is possible in java? Satyam16
How the threads are synchronized? BMC2
Hi Friends, I am beginner in java. what i know about synchonized keyword is,If more that one 1 thread tries to access a particular resource we can lock the method using synchronized keyword. Then after that how the lock is released and how next thread access that.Please explain with example.  1
Can a class inherit the constructors of its superclass? Wipro7
how many ways to create Thread and which one is good? runnable interface ot Thread class? Satyam3
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com