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

Which method cannot be overridden in java?

1043


Why is stringbuffer called mutable?

1043


What is the purpose of default constructor?

1035


What is a Transient Object?

1132


what is thread? What are the high-level thread states? : Java thread

1325


Explain about oops concepts.

1173


How do you start a new line in java?

1036


What is return in java?

1025


Can we use synchronized block for primitives?

1127


what is the swingutilities.invokelater(runnable) method for? : Java thread

1081


Tell some latest versions in JAVA related areas?

1041


How do you use spaces in java?

1037


How we can declare a static variable?

1151


What is the difference between super class & sub class?

1279


Explain the difference between abstract classes and interfaces in java?

1263