IN java collections we have both interfaces and classes.
instead of using interfaces why we can't use classes only
like that why we can't use interfaces only. why we need two
things interface and class.
Answer Posted / easwar
Java doesn't support multiple inheritance.We achieve
multiple inheritance using interface concept.A class can
have only one super class and number of interface.And more
over interface has only abstract methods. We need a sub
class to implement it.We cannot create an object for an
interface. So we cannot use only the classes or only the
interfaces in java.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How do you square a number in java?
Is java hashset ordered?
State the difference between strings and arrays.
Explain about version control?
What do you mean by exception handling in Java?
Explain what access modifiers can be used for methods?
When should I use stringbuffer?
How many bits is size_t?
What is a line separator in java?
What is the default size of set in java?
Why does the integer quotient -0/3 yield 0, but the double quotient -0.0/3.0 yields – 0.0?
What do you understand by the term string pool?
How many types of the indexof method are there for strings?
How do I get the | symbol on my keyboard?
Can you use abstract and final both with a method?