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

can u give one sinario when you use Abstract Class and When
you use Interface.

Answer Posted / srinivasa

If we have more than two classes with same method names but
their implementation is different.we can go for interface.
Example: JDBC API Interfaces. Every data base vender
implements these interfaces with thier implementation code.

If we want to use some common method implementaions for
multiple classes along with their own implementation we can
go for abstract class.

Example:Servlet API:
HttpServlet is an abstract class in which init() is
implemented used by every servlet that extends.Every
servlet implement their own service method.

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the function of compareto in java?

1008


What do you understand by java?

923


Can size_t be negative?

1069


How to sort an array in java without using sort method?

845


What is the difference between choice and list?

1042


Is there a case when finally will not execute?

942


What is byte value?

944


Is sizeof a keyword in java programming?

1014


What does index mean in java?

925


What is the difference between overriding & overloading?

1003


Explain illegalmonitorstateexception and when it will be thrown?

1038


Explain notify() method of object class ?

1033


What is hashing principle in java?

969


what are abstract functions?

974


Can I override protected method in java?

1018