Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 meant by data hiding in java?

1162


What is the full meaning of java?

1045


What is class and object in java?

1012


What do you understand by weak reference?

1017


How we can skip finally block of exception even if some exception occurs in the exception block in java?

953


What is the difference between the paint() and repaint() methods in java programming?

1195


What is the difference between hashmap and hashtable? What is an interface?

1171


What are the high-level thread states in java programming?

1063


What is the common usage of serialization? What exceptions occur during serialization?

1135


What is the transient keyword?

2189


What is the use of flag?

1094


Implement 2 stacks with just 1 array. The stack routines must not indicate overflow unless every slot in array is used.

1330


How many types of the indexof method are there for strings?

975


What is slash r?

1012


Can we use catch statement for checked exceptions when there is no chance of raising exception in our code?

1041