RE:
What is the difference between abstract class & Interface.
ABSTRACT CLASS contains general methods aswell as abstract methods whereas INTERFACE contains only abstract methods. A programmer uses Abstract class to specify the common features of all objects and abstract methods when the methods have diff. implementations for diff. objs. he himself writes the classes implementing abstact methods. A programmer writes an Interface when he doesn't know how to implement the features of a s/w and he leaves the implementation to be provided by 3rd party vendors
RE:
What is the difference between abstract class & Interface.
interfac is 100 % abstract class.All the methods in interface is implictly abstract.interface does not hava body.But in Abstract class there must be one method to be concrete itself
RE: What is the difference between abstract class &am...
interfaces are 100% abstract entities. they must have all methds having no body(abstract methods), while in abstract classes , its not necessary to have any abstract method. it can have or it might not have.
RE: What is the difference between abstract class &am...
in interface all the methods should be declared as abstract
in abstact class all methods need not be declared as abstract and if we do not provide the implementations of all the methods of the abstract class the class that extends this class should be declared as abstract
RE: What is the difference between abstract class &am...
In interface all data members are final and static means they wont be changed and can be called by using classname and "." operator and we can provide multiple inheritance which is not possible in the case of abstract classes.abstract classes contains general methods as well as abstract methods.
RE: What is the difference between abstract class &am...
Choosing interfaces and abstract classes is not an either/or proposition. If you need to change your design, make it an interface. However, you may have abstract classes that provide some default behavior. Abstract classes are excellent candidates inside of application frameworks. Abstract classes let you define some behaviors; they force your subclasses to provide others. For example, if you have an application framework, an abstract class may provide default services such as event and message handling. Those services allow your application to plug in to your application framework. However, there is some application-specific functionality that only your application can perform. Such functionality might include startup and shutdown tasks, which are often application-dependent. So instead of trying to define that behavior itself, the abstract base class can declare abstract shutdown and startup methods. The base class knows that it needs those methods, but an abstract class lets your class admit that it doesn't know how to perform those actions; it only knows that it must initiate the actions. When it is time to start up, the abstract class can call the startup method. When the base class calls this method, Java calls the method defined by the child class. Many developers forget that a class that defines an abstract method can call that method as well. Abstract classes are an excellent way to create planned inheritance hierarchies. They're also a good choice for nonleaf classes in class hierarchies.
RE: What is the difference between abstract class &am...
abstract class has at least one method abstract and it has more than one method abstract and that method should be implemented by the class.
In case of Interface it should be all method abstract bydefault and it necessary to implemented.If programmer implements all the method of the class then he uses the interface and interface is a keyword in java.