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

Give me example of derived data types.

1145


what is the volatile modifier for? : Java thread

989


What comes to mind when someone mentions a shallow copy in java?

1105


How to change the priority of thread or how to set the priority of thread?

1034


What are keywords give examples?

1050


What is the difference between numeric and integer?

1003


Explain a few methods of overloading best practices in java?

976


If a class is declared without any access modifiers, where can the class be accessed?

1062


What are multiple inheritances?

1100


What is the difference between double and float variables in java?

1138


Is array primitive data type in java?

994


What is the static method?

1069


What is the buffer limit?

1024


How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?

958


Can a method be overloaded based on different return type but same argument type?

955