Paranj,

You can create your own abstract class which provides the method(s)
declaration(s) that is/are common to all your subsequent concrete classes,
but which have no implementation code.  You would then use your abstract
class via inheritance to create your concrete classes, each of which
implement their "shared" or "common" methods differently.  You can create
instances of these concrete classes that are inherited from your abstract
class, so you can use them as beans in your JSP.  Just remember, a Java bean
by it's definition can take no parameters as part of it's constructor, where
as a Java class can.

Just as in C++, you cannot instantiate an abstract class, so if your
question pertains to whether you can create an abstract Java class and use
an instantiation of it as a bean in your JSP page, the answer is no.  By its
very nature, an abstract class has as least one method that has no
implementation code.

Celeste


-----Original Message-----
From: Paranj, Bali [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 12, 2001 10:22 AM
To: [EMAIL PROTECTED]
Subject: Abstract JavaBean


Hi,

Is it possible to have a abstract JavaBean ? There are two business
functions which share some methods and they differ in other methods. So, can
I use abstract bean in this case ? I am calling the concrete beans from a
JSP page.

Thanks for your time,
Bala Paranj

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to