What is the difference between Abstract Class and Interface

Answer Posted / ranjith

Abstract class:its an incomplete class,containg default
implementation for its sub classes. it contains both
abstract and concrete methids. access specifier
public,private and protected can be used for methods and
variable declaration.atleast on abstract method should be
present in the class. then class extending the abstract
class should override all the abstract methods or the
extended class should be abstract. only one abstract class
can be extended at a time..it contains keyword abstract.it
supports tight coupling.

Interface: all the methods and variable declarations in
interface are either public or abstract.private and
protected acces specifer can be mentioned. it provides
default implementaion for the class that implement it.none
of the methods conatain any method body. the class that
implements should provide implementation for all the
methods in the interface. it provies loose coupling(inter
dependency between the class and interface is less)

Is This Answer Correct ?    23 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is age discrete or continuous?

908


How do you add spaces in java?

777


What is the difference between C++ and Java and your preferences?

873


What is the difference between stringbuffer and stringbuilder?

789


What’s the difference between callable and runnable?

791


What is the difference between a constructor and a method?

891


What is the difference between Java1.4 and Java1.5

2082


How large is a boolean?

794


What is a function easy definition?

766


Difference between class#getinstance() and new operator ?

911


How to handle a web browser resize operation?

786


Do you know how to reverse string in java?

846


What is == in java?

790


Is java platform independent?

784


What is r * in math?

757