Difference between Abstract Class & Interface?

Answer Posted / rakesh.fanu

Abstract Class :-
Abstract class should be declare with abstract.
Abstract Class must be extended by its sub class.
Abstract Class has abstract method and also method with
body also.
Abstract Class has not instance variables , it contain only
Constant.
An abstract class cannot be instantiated

Interface :-
Interface must be Implemented by another class.
Interface has only abstract method.
Interface has not instance variables , it contain only Constant.
An Interface cannot be instantiated

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I start netbeans?

660


What is the difference between deep copy and shallow copy in java

745


Who is at risk in java? : java security

691


I have deployed a .war file in my application server comprising of struts and hibernate.If i want to change the "dialect" property of hibernate cfg file how can i change(I have only .war file)... Thanks in advance

1605


What are the benefits of a jar file?

763


What is meant by pass by reference and pass by value in java?

685


Is lambda functional programming?

646


What is persistence xml in java?

662


What is gpt and gpc? : java security

717


What are java’s rules regarding tabs, spaces and newline characters?

1206


What is lazy loading in jpa?

615


Can the main method be declared final?

716


What is the locale class?

708


Why do we need framework in java?

614


What is stateless object in java?

667