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


Please Help Members By Posting Answers For Below Questions

Define the remote object implementation?

1987


How database connectivity in XML is achieved?

1758


Java is fully object oriented languages or not?

528


How messaging services are done, before release of JMS?

1577


Is the ternary operator written x : y ? Z or x ? Y : z ?

625






Can you give me a simple example of using the requiredif validator rule?

591


What is re-entrant. Is session beans reentrant. Is entity beans reentrant?

567


To what value is a variable of the string type automatically initialized?

599


In inglish: How to convert jar to exe files? Em português: Como converter arquivos .jar para .exe?

2146


Difference between DurableSubscription and non- DurableSubscription?

1703


why static class in java

1262


Have you used threads in Servelet?

1923


Describe responsibilities of Activator?

1655


Should synchronization primitives be used on bean methods?

540


Can I use javascript to submit a form?

598