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 difference between abstract and interface?
can i give real time example for the two topics?

Answer Posted / madhu samala

abstract is a keyword which can be applied to a class or a
class method. When we declare a class as an abstract one,
it may contain the abstract methods. Abstract method is a
method which contains only the declaration but not the
definition (body). The body for this method will be
provided in it's derived classes.
Note: An abstract class may not contain any abstract
method, but if it contains it must be declared as an
abstract class.
An interface is a contract. The contract will be between
the interface and the class.
An interface only contains abstract methods.i.e. They
contain only the method definition not the body.
The body for these methods must be provided inside the
class which implements that interface. If it doesn't
provide then it has to be declared as abstract.

Is This Answer Correct ?    12 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the functionability stubs and skeletons?

1111


What is math exp in java?

1013


What is keyword and identifier?

1088


Write a program to show whether a graph is a tree or not using adjacency matrix.

1050


Is jdk required on each machine to run a java program?

1227


How will you calculate the depth of a binary tree if the tree contains 15 nodes?

1043


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

953


Is heap stored in ram?

913


What does a boolean method return?

1166


Explain an algorithm to find depth of a binary tree.

1003


What package is math in java?

959


What is collection class in java? List down its methods and interfaces.

907


How hashmap increases its size in java?

941


Can we override private method in java?

1051


What is anti pattern in java?

918