• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

abstract classes

 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
where could i read about usage of abstract classes? i couldn't find nothing suitable for me on java.sun.com.
could you suggest me something?
thanx
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you do a google search on this site for +abstract+class you will find alot of reading material on the subject.
 
Andrew Lit
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
of course i will but i thought that someone could suggest something here
but thanx anyway
 
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Java Language Specification has a good description of abstract classes and how to use them.
Java Language Specification section 8.1.1.1, Abstract Classes
[ July 24, 2002: Message edited by: Dan Chisholm ]
 
Ranch Hand
Posts: 1055
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Basically, an abstract class is a class that cannot be instantiated. If you like, you can treat it as an interface. An abstract class is normally expected to be subclassed and its methods overriden/implemented by this subclass.
It doesn't matter if the abstract class has abstract methods or not. You can have an abstract with all of its methods implemented. However, a class that implements an interface or extends an abstract class, and does not implement all of superclass's methods, must be declared as an abstract class.
 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From the Java API, jav.io.InputStream is an abstract class.It is the superclass of all classes representing an input stream of bytes.
InputStream has the following abstract method:
public abstract int read();
which a subclass must provide an implementation for.Some of the subclasses of InputStream are FileInputStream,ByteArrayInputStream and FilterInputStream.
 
Andrew Lit
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you very much
 
reply
    Bookmark Topic Watch Topic
  • New Topic