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
Explain covariant method overriding in java.
What is module in project?
How can you write a loop indefinitely in java programming?
Is null a string or object in java?
Can we declare a constructor as final?
What are filterstreams?
Does anyone still use java?
What does percent mean in java?
Can keyword be used as identifier?
What is difference between == equals () and compareto () method?
What is the function of java?
Which java collection does not allow null?
Can we access the non-final local variable, inside the local inner class?
What are the Static and Dynamic Variables? Differentiate them.
What is a classloader in java?