In real time project when will we use Abstract class. and
what are the difference between abstract and interface.
Answer Posted / naveen verma
Abstract Class:- its should have declared as abstract and must contain atleast one abstract method. an abstract class can be extended from either an abstract class or the class which is extending the abstract class should implement all methods of abstract method.
Interface:- In interface the methods are only declared not define the class which implementing the interface can define the method body as per its need. its not mendatory to define every method of the interface.
In really time application we extend abstract class only we when we need to modify the class. where as interface can be used to implements its method.
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
Which javutil classes and interfaces support event handling?
How substring() method of string class create memory leaks?
How to implement dphibernate to activate lazy loading in Flex with java ?thanx in advance!
Which are the different segments of memory?
Where can I find seam examples and documentation?
Where we can write Rmi registry in the code, without having to write it at the command prompt?
Explain what is synchronization?
What is the difference between the string and stringbuffer classes?
What are externizable interface?
What is a class loader?
Can I map more than one table in a cmp?
What is the RMI and Socket?
Define the remote object implementation?
Difference between swing and awt?
Why a client should be multithreading? Explain.