• 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 Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

how can i get the referance of the abstract class

 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
there is one abstract class
i want its referance how can i get it
thanX in advance
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
reply
    Bookmark Topic Watch Topic
  • New Topic