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
Can arraylist hold different types java?
How many bits is a 64 bit byte?
What is a lambda expression ? What's its use ?
What is codebase?
Write a program to find the whether a number is an Armstrong number or not?
What is a method vs function?
Explain exception chaining in java?
What is the private method modifier?
How many types of string data types are there?
Wha is the output from system.out.println(“hello”+null); ?
Is java jre still free?
What are advantages of exception handling in java?
Is char a data type in java?
What defines function?
What is string variable?