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 is string length in java?

495


Can I extend singleton class in java?

635


what is meant by encapsulation?

634


What is final access modifier in java?

596


How do you trim a space in java?

505






What is abstract class constructor called?

573


What is the difference between static and global variables and also define what are volatile variables?

559


What is a method in programming?

641


Can an integer be null java?

563


What are the data types supported by java?

552


What is abstraction in java?

621


What are the types of inner classes (non-static nested class) used in java?

572


What is singleton math?

580


How is string stored in java?

564


How many ways can we create singleton class?

509