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 does math floor () do?

958


What is the difference between compile-time polymorphism and runtime polymorphism?

990


How large is a boolean?

1009


Can we use different return types for methods when overridden?

989


What is the type of lambda expression?

1017


What about main thread in java?

1110


What is java basic concept?

1032


Can arraylist contain null values?

1007


What is unicode in java?

923


What is application system?

932


What are three advantages of using functions?

1005


What are the differences between throw and throws?

1071


Explain what is Marker interface?

1084


What method is used to specify a container's layout in java programming?

1123


What is the use of isempty in java?

1012