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
What is return null in java?
What is function declaration?
Is java still relevant?
What are checked exceptions?
What is a dot notation?
Can we clone singleton object in java?
What is the difference between math floor and math round?
How will you calculate the depth of a binary tree if the tree contains 15 nodes?
What is the purpose of abstract class?
Which is better singleton or static class?
What are java threads?
Where and how can you use a private constructor?
What are the legal parameters?
Can we declare main () method as non static?
What is the association?