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
Where can I ask questions and make suggestions about seam?
What happens when a thread cannot acquire a lock on an object?
Is the ternary operator written x : y ? Z or x ? Y : z ?
Explain what is synchronization?
Can I import same package/class twice? Will the jvm load the package twice at runtime?
Do we need to override service() method
What is the difference between a menuitem and a checkboxmenuitem?
When a thread blocks on i/o?
What do you mean by Socket Programming?
How task's priority is used in scheduling?
What are the different types of exception?
How messaging services are done, before release of JMS?
the same information whether it will connect to the database or it will be used previous information?
What is permgen or permanent generation?
What is the RMI and Socket?