adspace


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 / shaik baji

Interface in the sence a generic templet that means it will
define a generic functionalities of a group.
For Ex:- We can say "Car" as an interface

1)let's asume if you want a List interface functionalities
the your class should implements the List interface, that
means you should implement all the methods which are
available in List interface even you are not using all the
methods so that the Java developers designed the classes
which are implements the java.util interfaces.

Now if you want any interface functionalities then you just
create an object of that related java.utill package class
and call the methods by using the object.

2)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.

Is This Answer Correct ?    3 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between break and continue statements?

1128


Explain public static void main(string args[]) in java.

1078


What are the differences between heap and stack memory in java?

1142


What is a constructor overloading in java?

1125


What is java string pool?

1083


What do you mean by an interface in java?

1105


explain different ways of using thread? : Java thread

1084


Write a program to print count of empty strings in java 8?

1087


What is a classloader in java?

1090


Is minecraft 1.15 out?

1045


What is the difference between equals() and == in java?

1042


What is parsing in java?

1043


How to create a base64 decoder in java8?

1138


What is an object in java and how is it created?

1141


Write a program to find the whether a number is an Armstrong number or not?

1101