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 / varun kumar

1.interface contains methods that must be abstract;
abstract class may contain concrete methods.
2.interface contains variables that must be static and
final; abstract class may contain non-final and final
variables.
3.members in an interface are public by default, abstract
class may contain non-public members.
4.interface is used to "implements"; whereas abstract class
is used to "extends".
5.interface can be used to achieve multiple inheritance;
abstract class can be used as a single inheritance.
6.interface can "extends" another interface, abstract class
can "extends" another class and "implements" multiple
interfaces.
7.interface is absolutely abstract; abstract class can be
invoked if a main() exists.
8.interface is more flexible than abstract class because
one class can only "extends" one super class,
but "implements" multiple interfaces.
9.If given a choice, use interface instead of abstract
class.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the latest version of java?

1049


Which of the classes will have more memory allocated?

912


What are different exception types exceptions available in java ?

949


What are untrusted applets?

1069


Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)

1283


What is the difference between pass by reference and pass by pointer?

999


Which method cannot be overridden in java?

945


What is var keyword ?

1124


What is the lifetime and scope of a variable?

955


How can we use primitive data types as objects?

899


Explain parallel processing in java8?

1152


Difference between character constant and string constant in java ?

959


What is the relationship between class and object?

983


Difference between object instantiation and construction ?

1007


What does sprintf return?

1007