Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2008

Tip: Looking for answers? Try searching our database.

abstract class

Thread view: 
ashutosh.singh.kumar@gmail.com - 16 Apr 2008 13:00 GMT
Why can't we use abstract class in place of Interface?
Janusch - 16 Apr 2008 13:22 GMT
On 16 Apr., 14:00, ashutosh.singh.ku...@gmail.com wrote:
> Why can't we use abstract class in place of Interface?

Abstract class is a class.

Class has only ONE superclass.

Class can implement many interfaces.

Is this you problem?

Example:
class A extends B implements C,D,E,F,(...),Z{  }
A:class
B:superclass
C - Z: interfaces

Janush
http://kathorncity.no-ip.info/en/
Eric Sosman - 16 Apr 2008 13:26 GMT
> Why can't we use abstract class in place of Interface?

    We can, under the right circumstances.  Please be more
specific: What characteristics of abstract classes and
interfaces are you having trouble with?

Signature

Eric Sosman
esosman@ieee-dot-org.invalid

Chase Preuninger - 16 Apr 2008 14:02 GMT
Because you can only extends 1 class.  You use a abstract class when
you fell that it would not make sense for an instance of that class to
be created, but you want to add more than what you can provide with an
interface.
Roedy Green - 24 Apr 2008 09:51 GMT
On Wed, 16 Apr 2008 05:00:18 -0700 (PDT),
ashutosh.singh.kumar@gmail.com wrote, quoted or indirectly quoted
someone who said :

>Why can't we use abstract class in place of Interface?

you can.  For when to use each, see
http://mindprod.com/jgloss/interfacevsabstract.html
Signature


Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.