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 not supproting multiple inheritance?
 Question Submitted By :: AnithaBabu1
I also faced this Question!!     Rank Answer Posted By  
 
  Re: why java not supproting multiple inheritance?
Answer
# 1
well as in c++ we have multiple inheritance, but not in java

becz if it is their then having method of same signature
(means same return type, list of paraments, access 
specifiers) in 2 different classes and both r extended by 
some class AA then while calling method in base class, it 
would break down the jvm that to which classes method to be 
called.
EX:-
class BB
{
 public void a(int x)
 {
  System.out.println("call from BB");
 }
}
class CC
{
 public void a(int x)
 {
  System.out.println("call fro CC");
 }
}
class AA extends BB,CC
{
 a(5);
}
 
Is This Answer Correct ?    1 Yes 1 No
Aman Kr. Aggarwal
 
  Re: why java not supproting multiple inheritance?
Answer
# 2
Why? Because it gets confusing.
 
Is This Answer Correct ?    0 Yes 0 No
Xkrebstarx
 
 
 
  Re: why java not supproting multiple inheritance?
Answer
# 3
BCoz of DIAMOND Problem......if A extends B & B extends 
A..in this case b wil override the methods of A class..if c 
Extends A ..in this case  C wil hav Both the properties of 
A,B ....if D extends  A which properties should D 
inherits ..if it B,C propetries Bcoz B are having the same 
methods of A & c is having the same methods of A...there 
occurs the Diamond problem..
 
Is This Answer Correct ?    1 Yes 0 No
Ershad
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
explain the classification of exception and hoew to handle the exceptions  2
What happens when you assigned a 'double' value to a 'String'?  2
what is difference betwwen hashmap and hashtable ? Fidelity5
what is finalmethod & final variable with example? HP2
Which class is the immediate superclass of the Container class?  1
Explain pass by reference and pass by value? Wipro3
What is the % operator?  2
Diff between C++ and java? TCS7
Hi, This is ravi i have a question like this i have string "UNDERSTAND" now i want to count the letters how many times it occures.i.e from the above string the out put should be like this U-1,N-2,D-2,E-1,R-1,S-1,T-1,A-1. how can i achieve this Thnaks in advance for your response ..  3
How to create an instance of a class if the class has private constructor?  2
What is static and a non-static inner class?  1
Can a class inherit the constructors of its superclass? Wipro4
What is the is a and has a relation ship in oops concept in java? BearingPoint5
how to handle http request in struts Polaris2
What is meant by serialisation and deserialisation?  2
what is difference between excute query ()and execute update ()? Symphony4
Define Compiling?  2
how can u create the object with out new operator  2
What is multiple inheritance & can we implement it in java? Satyam4
What is run time polymorphism? Elementus-Technologies5
 
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