• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

abstract classes

 
Andrew Lit
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • 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
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
of course i will but i thought that someone could suggest something here
but thanx anyway
 
Dan Chisholm
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
  • 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 ]
 
Anthony Villanueva
Ranch Hand
Posts: 1055
  • Mark post as helpful
  • send pies
  • 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.
 
Snigdha Solanki
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
thank you very much
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic