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
Given a singly linked list, find the middle of the list in a single traversal without using temporary variable.
What do you mean by an object in java?
In how many ways we can do synchronization in java?
Can a class have multiple superclasses?
Write code of any action class?
Is char a data type in java?
Explain the pointers in Java?
What are voids?
What are the 3 types of loops in java?
What is the difference between the paint() and repaint() methods?
Is java a utf 8 string?
What are the two ways of implementing multi-threading in java?
What is use of inner class in java?
What is a line break?
What is this keyword in java?