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
Implement a stack with push (), pop() and min() in O(1) time.
What is the difference between compare and compareto in java?
Is string a wrapper class?
Can I declare class as static or private?
What are the classes of java?
Explain about field hiding in java?
Does google use java?
What is java virtual machine? Explain
What is the difference between a static and a non-static inner class in java programming?
What is final access modifier in java?
Differentiate between static and non-static methods in java.
Which language is java?
Can constructor be inherited?
What are the different tags provided in jstl?
Hi Anyone know the model / questions of the Federal bank sample questions for the post of Specialist Officers - Programmers. Please post if anyone have..