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

Answers were Sorted based on User's Feedback



What is the difference between Abstract Class and Interface..

Answer / sushil

Abstract class can contain abstract as well as non-abstract
methods while Interface can have only abstract Methods

Is This Answer Correct ?    48 Yes 3 No

What is the difference between Abstract Class and Interface..

Answer / ranjith

Abstract class:its an incomplete class,containg default
implementation for its sub classes. it contains both
abstract and concrete methids. access specifier
public,private and protected can be used for methods and
variable declaration.atleast on abstract method should be
present in the class. then class extending the abstract
class should override all the abstract methods or the
extended class should be abstract. only one abstract class
can be extended at a time..it contains keyword abstract.it
supports tight coupling.

Interface: all the methods and variable declarations in
interface are either public or abstract.private and
protected acces specifer can be mentioned. it provides
default implementaion for the class that implement it.none
of the methods conatain any method body. the class that
implements should provide implementation for all the
methods in the interface. it provies loose coupling(inter
dependency between the class and interface is less)

Is This Answer Correct ?    23 Yes 2 No

What is the difference between Abstract Class and Interface..

Answer / tarun jangra

1. An abstract class is a specialization whereas Interface
is a generalization. That means an abstract class is created
when only few class wants to share some methods,when you
have to create some methods to be shared by all the classes
then interface is used.

2. An abstract class can have non-abstract methods (means
methods with implementation) while all the methods in an
Interface are by default abstract.

Is This Answer Correct ?    11 Yes 0 No

What is the difference between Abstract Class and Interface..

Answer / ravi

1.A programmer creates abstract class when there are some
common features shared by all the objects.
A programmer writes an interface when all the features
should be implemented differently for different objects.

2.When an abstract class is written the programmer should
provide sub classes to it.
A programmer writes an interface when he wants to leave
implemntation classes to third party vendors.

Is This Answer Correct ?    8 Yes 0 No

What is the difference between Abstract Class and Interface..

Answer / vikrant

Nothing stops you using interfaces and abstract classes
interchangeably. The difference is in the ideology where to
use it.

An abstract class is to be used when one needs to create a
hierarchy. e.g. Poodle, Pointer and Chihuahua are all breeds
breeds of dogs, they have some common characteristics as
dogs and some special characteristics of its breed. so all
breeds (Poodle, Pointer and Chihuahua classes) will inherit
from the Dog class.

Interface on the other hand is just a contract. The
implementing classes need not be related. Say a 3-D figure.
Sphere, Cone, Cylinder are all 3-D shapes they have nothing
in common apart from being 3-D figures. Each will have their
own equation for calculating area, perimeter, volume. All
need to specify in Shapes interface is that the implementing
class must be able to calculate area, perimeter, volume.

Is This Answer Correct ?    4 Yes 0 No

What is the difference between Abstract Class and Interface..

Answer / arun bhat

Abstract class can have normal methods also but Interface
consists of only abstract methods.....

Is This Answer Correct ?    3 Yes 0 No

What is the difference between Abstract Class and Interface..

Answer / guest

An abstract class can have instance methods that implement a
default behavior. An Interface can only declare constants
and instance methods, but cannot implement default behavior
and all methods are implicitly abstract. An interface has
all public members and no implementation. An abstract class
is a class which may have the usual flavors of class members
(private, protected, etc.), but has some abstract methods.

Is This Answer Correct ?    1 Yes 0 No

What is the difference between Abstract Class and Interface..

Answer / e.bhavani

1) all abstract methods of the abstract class should be
implemented in its sub classes
all the (abstract) methods of the interface should be
implemted in its implementation classes
2) abstract class can contain instancevariables also
interace can not contation instance varibles. it contations
only constants.

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More Core Java Interview Questions

Discuss about garbage collector in Java.

0 Answers   Agilent, Integreon, ZS Associates,


What does pointer mean?

0 Answers  


What’s the difference between the methods sleep() and wait()?

0 Answers  


Why scanner is used in java?

0 Answers  


What are the differences between getting and load method?

0 Answers  


What is the definition of tree ?

0 Answers   Amazon,


What is the range of the short datatype?

2 Answers  


What is the best definition for data?

0 Answers  


What value is a variable of the string type automatically initialized?

0 Answers  


What is a method type?

0 Answers  


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

0 Answers  


Is main a keyword in java?

0 Answers  


Categories