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

what is the difference between abstract class and
Interface?where we can use it in realtime projects?

Answer Posted / abilash

1)If we r having 2 classes, both classes need a method with
same business logic(definition). Then we can go for an
abstract class. In this abstract class we can define the
method with functionality. And the two classes will extend
this abstract class.
2)In other case if two different classes wants two different
functionalities with same method name , then we go for an
interface with abstract declaration of method.And the two
classes will implement the interface and override the method
with different business logic

Is This Answer Correct ?    31 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is nested class?

946


How do you reverse a string in java?

1052


What is the purpose of methodology?

1025


How many wrapper classes are there in java?

961


What is string [] java?

898


what r advatages of websphere? & how to deploy?

2100


What is empty list in java?

1022


What checkbox method allows you to tell if a checkbox is checked?

945


What is arrays fill in java?

943


Explain super keyword in java.

988


What is difference between wait and notify in java?

1055


What is the purpose of the return statement?

982


Can we have multiple classes in a single file?

912


Difference between string, string builder, and string buffer?

1019


Difference between a class and an object?

963