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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how can i intentiate an abstract class

 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
how can i intentiate the abstract class
thanX in advance
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
hey u just extend the abstract class and then create the object of that class its simple

------------------
P Ankireddy
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
that is indeed the only way. An abstract class cannot be instantiated (no matter what Office 97 thought it could, with obvious results).
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Abstract class is declared to show the hierarchy only it doesn't any body defined and you can't instantiate an object of them.
For instantiating them you have to inherit the abstract class and overlaod its functions.
 
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Read the answer to the following 2 questions, you might be interested:

1) How to find out "What and Who" about an instantiation of an interface?
2) Why abstract method Graphics.drawString() can work without implementation?

 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

Originally posted by Naresh Nihalani:
Abstract class is declared to show the hierarchy only it doesn't any body defined and you can't instantiate an object of them.
For instantiating them you have to inherit the abstract class and overlaod its functions.


Naresh:
let me get this straight........
For instantiating them you have to inherit the abstract class and overlaod its functions
I would not agree to this stmt. This is wrong, IMO.
We know abstract classes DONOT have any code, atleast for the abstract methods...you said that!
Having said that, you cannot say overload.
IMO, the right java terminology is to say you implement
them.
regds.
- satya

[This message has been edited by Madhav Lakkapragada (edited February 08, 2001).]
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

this thread is being closed at the request of Mateen.
regds.
- satya
actually the problem is that
i mistakenly
started a new topic in
java intermediate section
so would u plz close this topic
" how can i get the referance of the abstract class "
thanX
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic