Why java Don't Support Multiple interitence
Answer Posted / samir rana
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 | 4 No |
Post New Answer View All Answers
How does varargs work in java?
What is the use of generics? When was it added to the Java development Kit?
Can two objects have same hashcode?
Say you want to store the information about a number of pets in an array. Typical information that you could store for each pet (where relevant) would be • Breed of animal • Animal's name • Its birth date • Its sex • Whether it has been sterilised or not • When it is due for its next inoculation • When it last had its wings clipped For each type of pet (eg. dog, cat or bird) you would typically define a class to hold the relevant data. Note: You do not need to implement these classes. Just answer the following questions. 3.1.1 What would be the advantage of creating a superclass (eg. Pet) and declaring an array of Pet objects over simply using an array of Objects, storing each of the instances of the different pet classes (eg. Dog, Cat or Bird) in it? 3.1.2 Would you define Pet as a class or as an interface? Why? (2) (2)
What is string length in java?
How do you create a method in java?
How to optimize the javac output?
What state does a thread enter when it terminates its processing in java programming?
What is the difference between the ">>" and " >>>" operators in java?
What is main method?
Explain wait(), notify() and notifyall() methods of object class ?
What is locale in java?
Define how can we find the actual size of an object on the heap?
Why does java not allow multiple public classes in a java file ?
A non-static inner class may have object instances that are associated with instances of the class’s outer class. A static inner class does not have any object instances.