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

Explain how to force the garbage collection in java.

971


What is the difference between C++ and Java and your preferences?

1114


Explain the usage of this with constructors?

1028


What is the destroy method?

1046


Which category the java thread do fall in?

1006


Explain the selection sort algorithm and state its time complexity?

1022


Give me an example of array and linked list? Where they can be used?

1011


Is {a, n, d} a palindrome? If you are given a random string, is it a palindrome or not?

1134


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

1024


What is return in java?

974


What is the difference between the size and capacity of a vector?

1044


Write a program to print 15 random numbers using foreach of java 8?

936


Tell me a few examples of final classes defined in Java API?

1099


What does escaping a character mean?

1021


Can we overload destructor in java?

996