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 / vanaja
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 ? | 19 Yes | 1 No |
Post New Answer View All Answers
Which software is used for java programming?
What is the difference between a method and a procedure?
What exactly is java?
Can list be null in java?
What does index mean in java?
Can size_t be negative?
Is it possible to override the main method?
Why do we use bufferedreader?
What is preflight request?
What restrictions are placed on method overloading?
What is a buffer in computer?
What is the default access specifier for variables and methods of a class?
Which number is denoted by leading 0x or 0x in java?
How to add menushortcut to menu item?
Can you explain the private protected field modifier?