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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the four pillars of java?

608


What does java edition mean?

529


What does int argc char * argv [] mean?

514


What is the constructor?

579


How do you start a new line in java?

516






What are predefined functions?

570


Is array a class?

517


What is protected access modifier?

572


What is visibility mode?

525


Explain the overview of UDP messaging.

731


Is an object null?

557


v-model life cycle

1618


What is array class in java?

592


What are the methods of object class ?

561


Why do we use regex?

555