Answer Posted / ujas doshi
No...Actually java does not support multiple inheritance.
You can say bcoz of reason mentioned by debapriya.
But if you want a class to be inherited from 2 classes you
can use a concept in java called interfaces..
class C extends A, extends B ---wrong, error, only one
class can be inherited
class C implements A, implements B ---fine, here A and B
are not classes but they are interfaces.
Now what are interfaces?
interfaces are similar to classes except a few things
1)Interfaces must contain static methods only
| Is This Answer Correct ? | 17 Yes | 10 No |
Post New Answer View All Answers
Why singleton pattern is better than creating singleton class with static instance?
What is unicode used for?
Is namespace same as package in java?
What is the size of int in 64-bit jvm?
Q1.A. Write note on “The class path Environment Variable”? B. Which are different kinds of source code? Q2.A. How to create an interface? B. Why convert an applet to an application? Q3.A. How to use Media tracker Class. B. How to use string tokenizer class. Q4 A. Explain the overview of UDP messaging. B. Difference between SQL Exception class and SQL Warning class. Q5. A. How to create com object in Java? B. Write short notes on “The properties class” Q6. A. When object is created and destroyed? B. Explain the JDB in depth & command line. C. Write short notes on Web Sites.
Can we print null in java?
What is the difference between inner class and nested class?
What is an example of a keyword?
Why webdriver is an interface?
What does next mean in java?
What are benefits of java?
In the below example, how many string objects are created?
Why parsing is done?
What is set in java?
What is charat ()?