what is difference between Interface and abstract class

Answer Posted / naveen

Interface is a specification it tells a class has what to do.
It is purely abstract class it contains abstract methods and final static variables.
Generally begining of the project PM or TL are providing the Interfaces, developers are implementing the Interfaces.

Abstract class

Abstract class is a mediator between Interface and Class , any common code is their that code written in Abstract class and then extend the Abstract class. Abstract class containing abstract and concreate methods.
Abstract class are used in Designing level.If take java predifined class we understand easily.

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Should database connections be singleton?

563


State the difference between creating string as new () and literal.

517


What is incompatible types in java?

532


Can we compare two strings in java?

554


What is java used for?

549






What is a generic data type?

564


What is set string?

586


Why arraylist is not synchronized in java example?

461


Is this valid in java ? Can we instantiate interface in java?

543


What is deserialization?

581


Is java still necessary?

613


Explain when classnotfoundexception will be raised ?

563


How do you write a scanner class in java?

557


Can private class be extended java?

557


What are the rules for naming an array?

518