Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > abstract class

Reply
Thread Tools

abstract class

 
 
ashutosh.singh.kumar@gmail.com
Guest
Posts: n/a
 
      04-16-2008
Why can't we use abstract class in place of Interface?
 
Reply With Quote
 
 
 
 
Janusch
Guest
Posts: n/a
 
      04-16-2008
On 16 Apr., 14:00, (E-Mail Removed) 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/
 
Reply With Quote
 
 
 
 
Chase Preuninger
Guest
Posts: n/a
 
      04-16-2008
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.
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      04-24-2008
On Wed, 16 Apr 2008 05:00:18 -0700 (PDT),
http://www.velocityreviews.com/forums/(E-Mail Removed) 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
--

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

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what is the difference between abstract class and pure abstract class? skishorev@yahoo.co.in C++ 4 05-17-2006 08:07 AM
Abstract Methods & Abstract Class Iyer, Prasad C Python 0 10-20-2005 06:35 AM
About abstract class and abstract method Sameer Java 4 08-31-2005 12:59 AM
Deriving abstract class from non-abstract class Matthias Kaeppler Java 1 05-22-2005 01:28 PM
Abstract class with no abstract functions Uzytkownik C++ 3 04-03-2005 05:45 PM



Advertisments