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 create a first line indent?
What is wrapper class example?
What is the difference between overriding & overloading?
What is the symbol for average?
Can we create object of inner class in java?
What are thread local variables?
What is bean? Where it can be used?
What are the special characters?
What is the applet security manager, and what does it provide?
What is int short for?
What is nextline method in java?
What is difference between an object and a class?
What is casting in java programming?
What are packages in java?
Is arraylist ordered in java?