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

How to use string tokenizer class.

1213


how to create daemon thread in java?

1080


What is exception propagation?

1135


What are advantages of exception handling in java?

1026


whar are the draw backs of programming lang step by step in Clang and next in C++ and next and in Java nad in .Net

2106


Explain the difference between collection api and stream api in java8?

980


I want to persist data of objects for later use. What is the best approach to do so?

1066


What are anonymous inner classes?

1012


How to do encapsulation in java?

1053


What two classes are used to read data only?

1101


explain autoboxing in java?

1013


How does linkedlist work in java?

934


What is lambda programming?

1018


Is integer immutable in java?

996


What are variable arguments or varargs?

1008