File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how can i get the referance of the abstract class

 
maateen ashraf
Ranch Hand
Posts: 122
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there is one abstract class
i want its referance how can i get it
thanX in advance
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There can never be an instance of an abstract class, therefore there can be no reference to one. A reference to a class cannot exist at all (unless you mean a pointer to the classfile loaded in memory by the JVM, which you can't get at).
 
maateen ashraf
Ranch Hand
Posts: 122
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,
Jeroen Wenting
i think that u couldn't understand what i actually asked.
anyhow we can have referance of abstract class but we cannot instentiate it directly but with the object of its child class....
 
Frank Carver
Sheriff
Posts: 6920
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's quite possible to hold a reference to an object of a child class, and treat it as if it is an instance of the abstract class. This is just the same as holding a reference to an object and treating it as if it is a reference to an interface which it implements. Interfaces and Abstract classes can never be constructed, but it's quite possible (and useful) to have variables with such a type.
For example:

[This message has been edited by Frank Carver (edited February 09, 2001).]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic