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
What is the difference between heap memory and stack memory?
What is an iterator interface in java programming?
What is void keyword?
What is java beans?
Which package has light weight components?
How does system arraycopy work in java?
How many types of design patterns are there?
How to implement a multithreaded applet?
In java, how many ways you can take input from the console?
What is the arraylist in java?
Explain how can you debug the Java code?
How can we break singleton in java?
What does snprintf return?
Is string is a data type in java?
what r advatages of websphere? & how to deploy?