In real time project when will we use Abstract class. and
what are the difference between abstract and interface.

Answer Posted / aravind

Depending upon the requirement.

Abstract class---->it contains zero or more abstract methods.

ex HttpServlet and GenericServlet
HttpServlet contains all sre concrete methods but it
declared as a Abstract class.

InterFace--->It contains all abstract methods.

if we extends the abstract class .there is chance to extend
another class.

if we implements the interface we can extends another class

Is This Answer Correct ?    17 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

whats is mean by tiles in struts

1876


What is the difference between static and non-static with examples?

1606


What are JTA/JTS and how they used by client?

1952


Name the eight primitive java types.

824


How task's priority is used in scheduling?

2010


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

982


What is ioc concept & explain it?

837


What is a session? Can you share a session object between different theads?

767


Java is fully object oriented languages or not?

748


what are memory considerations of jsp compares to other web components?

6272


What is the purpose of the wait() method?

830


What are the different approaches to represent an inheritance hierarchy?

825


What are externizable interface?

792


How would you reatach detached objects to a session when the same object has already been loaded into the session?

940


What are local interfaces? Describe.

906