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


Please Help Members By Posting Answers For Below Questions

What will happen if non-synchronized method calls a static synchronized method and what kind of lock it acquires?

1108


Why generics are used in java?

1052


What is object-oriented programming?

1122


Explain the significance of class loaders in bootstrap?

949


Explain how can you debug the Java code?

1070


Why is multiple inheritance not supported in java?

1031


Is java platform independent?

975


What does exp mean in math?

991


What are the differences between getting and load method?

1192


What is difference between wait and notify in java?

1140


Describe the various concepts related to object oriented programming (oop).

1030


What is the symbol for average?

1030


Can a static method be final?

1060


What is double parsedouble in java?

1050


How do I write a self declaration?

1110