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

Explain about automatic type conversion in java?

572


What is oops in java?

567


Explain the purpose of garbage collection in Java?

574


Is sizeof a keyword in java programming?

610


What are the data types supported by java?

550






Does string isempty check for null?

569


What is casting in java programming?

585


Is {a, n, d} a palindrome? If you are given a random string, is it a palindrome or not?

619


Is a string literal?

525


What is a lock or purpose of locks in java?

595


How do you check if two given string are anagrams?

553


How many arguments can be passed to main ()?

525


How do you achieve singleton?

533


How does linkedlist work in java?

508


Why are there no global variables in java?

587