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 / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What are three advantages of using functions?

534


Differentiate between the constructors and methods in java?

501


Hi Anyone know the model / questions of the Federal bank sample questions for the post of Specialist Officers - Programmers. Please post if anyone have..

1814


Does variable declaration allocate memory?

581


What is the major drawback of internal iteration over external iteration?

582






What is meant by collection in java?

547


What are keyboard events?

608


What is float in java?

557


How many threads can I run java?

536


Name few java util classes introduced with java 8 ?

499


Why do we need hashmap in java?

554


what is the volatile modifier for? : Java thread

521


What methodology can be utilized to link to a database?

504


Can we define constructor in inner class?

535


What are the fileinputstream and fileoutputstream?

565