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 / reddy
The purpose of interface is to have abstract methods and
the class which implemnts the interface has to define the
methods in the interface.
The reason why java collections have both interfaces and
classes is interface will have common methods which will be
needed by one or many classes. The classes which wants to
behave like this interface will implement this interface
and define methods in the interface.
Is This Answer Correct ? | 14 Yes | 4 No |
Post New Answer View All Answers
When would you use a static class?
Can you tell me range of byte?
What is the locale class in java programming?
What is the difference between the file and randomaccessfile classes?
Explain the Propertie sof class?
State the significance of public, private, protected class?
Can you achieve runtime polymorphism by data members?
What does mean in regex?
What is empty list in java?
How many types of parsers are there?
What does the string method compareto () do?
what is the difference between a threads start() and run() methods? : Java thread
Difference between keyword and identifier.
What is the byte order of byte buffer?
What do you mean by exception handling in Java?