what is the difference between abstract class and
Interface?where we can use it in realtime projects?

Answer Posted / sudhakar

1)We define an Interface in the Java application with a
set of abstract methods without any implementation. Which
means all the methods of an interface are by default
abstract methods and public methods.
2)Once an Interface is defined in the application then any
class can implement that interface, in such case the class
must be implemented with all the mehtods of the respective
Interface otherwise the class will become as abstract class.
3)A class can implement any no. of interfaces, in such case
the class must be implimented with all the methods of those
interfaces otherwise the class will become as abstract class

Is This Answer Correct ?    125 Yes 25 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain covariant method overriding in java.

547


What is module in project?

523


How can you write a loop indefinitely in java programming?

556


Is null a string or object in java?

554


Can we declare a constructor as final?

683






What are filterstreams?

619


Does anyone still use java?

588


What does percent mean in java?

592


Can keyword be used as identifier?

551


What is difference between == equals () and compareto () method?

535


What is the function of java?

519


Which java collection does not allow null?

719


Can we access the non-final local variable, inside the local inner class?

520


What are the Static and Dynamic Variables? Differentiate them.

609


What is a classloader in java?

538