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

What is the map interface?

609


How are commas used in the intialization and iteration parts of a for statement?

581


Why won’t the jvm terminate when I close all the application windows?

750


how i secure my site with the https protocol.what are the steps?

1732


What is message driven beam?

581






Explain what is orm?

672


what is meant by JRMP?

1809


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

600


Can constructors be synchronized in java?

617


What is scalable, portability in the view of J2EE?

1869


when A client sent a request to the server to open facebook page and close the browser after this request .at that time the same user do login by using a different browser then that session id will exist or not for the same client??

1100


What does module-relative mean?

573


whats is statement and procedure

1585


In RMI, inorder to sent the stub reference to the client, is we have to load the server object first into the memory or can we directly sent reference to the client?

1555


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

2154