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...


Can you explain the difference b/n abtract and interface
with a good example,?In what cases we have use abtract and
what case interface?

Answers were Sorted based on User's Feedback



Can you explain the difference b/n abtract and interface with a good example,?In what cases we have..

Answer / srihari

Interfaces are used to create prototype of classes. Interfaces would be using high-level access specifiers(public).

Abstraction is a mechanism in Java to expose the essential features of the class. Different levels of abstraction is achieved through Access specifiers.

Is This Answer Correct ?    6 Yes 0 No

Can you explain the difference b/n abtract and interface with a good example,?In what cases we have..

Answer / nt.jayan

Interface contains final variable and method signatures
only. All of this method and variable are should be public.
In Technically interface like Pure Abstract class.

Abstract class contains both abstract method also may having
some method defination. When we want to use some of the
functionality in abstract we use Abstract class.

Also, By using Interface we achieve multiple inheritence
using Implements. When we use Abstract class we can extends
only.

Is This Answer Correct ?    0 Yes 0 No

Can you explain the difference b/n abtract and interface with a good example,?In what cases we have..

Answer / manasa

Abstract means 4 which we cant give a concrete definition
for ex wtz d def for animal v cant give so v say animal as
abstract.
Interface came into existence to facilitate multiple
inheritance
Eg for abstract: animal is a abstract class and it contains
both abstract n non-abstract methods
But remember a non abstract class cannot contain abstract
methods
Suppose consider area as method and it is different for
diff shapes like circle,rectangle,square.... here area vil
b calculated for all d shapes bt their implementation is
diff n instead of callin dat area method again n again v
vil declare it once
Now lets move on to interface
for eg if we give a compliment to girl dat she sings like
lata mangeshkar n here both dat girl n lata are connected
together by a sing method n these both r two unrelated
things and in this case we use interface.....
thank u guys have a nice tym.....

Is This Answer Correct ?    0 Yes 1 No

Can you explain the difference b/n abtract and interface with a good example,?In what cases we have..

Answer / ipdarsini

Interface is the 1st Level.here methods does not contain
any executable code.just it contains only declerations.here
in interface level we does not know anything.
Abstract class is a class which contains methods which may
contains exceutable code or not.this is the 2 nd level.here
in abstarct class level we know some thing.
for ex take a maruthi car.......
in interface level.
we doesn't know about egine company........some parts.....
we know .....but its not sure...
in abstract class level
for ex take a maruthi 800 car......
we knows the comapany of that car.
here we know about some thing bcz here they mentioned
maruthi 800....

thats the difference.....

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More Core Java Interview Questions

How core java/j2ee project performance can be measured ?

1 Answers  


Can we declare an array without size in java?

0 Answers  


if i have one string class then how can you achive this class functionality of this class?

3 Answers   Fidelity, iFlex,


Which class is the superclass for all the classes?

0 Answers  


Write a regular expression to validate a password. A password must start with an alphabet and followed by alphanumeric characters; its length must be in between 8 to 20.

0 Answers  


What is java full form?

0 Answers  


What is the static keyword?

0 Answers  


How can we access some class in another class in java?

0 Answers  


Can we instantiate interface in java?

0 Answers  


What is 3-tier model?

3 Answers   Wipro,


What is meant by overloading?

0 Answers  


What is the common usage of serialization? What exceptions occur during serialization?

0 Answers  


Categories