A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
doubt in abstract class
manas ranjan mandal
Joined: Apr 02, 2008
Dec 16, 2008 21:53:00
Abstract class has a constructor so why can't we create instance of abstract class?
Thanks in advnace
Joined: Nov 24, 2005
Dec 16, 2008 22:20:00
Abstract class has a constructor
Who is going to implement your abstract methods ?
All roads lead to JavaRanch
Joined: Dec 15, 2008
Dec 16, 2008 22:36:00
Create a instance need a constructor, but not just only a constructor. All of its components must be defined clearly including abstract method.
A man takes responsibility for his actions, right or wrong - <<Battlestar Galactica>>
Joined: Oct 13, 2005
Dec 17, 2008 04:35:00
I have a dubious and inaccurate way of thinking of an object. For every object which isn't specifically an
(note: O/o) it has two components:
The part from its own class, and
The part from its superclass
If the superclass is abstract, you still need to create that part of the object, and that part will (probably) still need its constructor.
actually instantiate an abstract class directly, but only as an anonymous class which is beyond the bounds of the beginner's forum.
I agree. Here's the link:
subject: doubt in abstract class
usage of a class
A mock question
A question about container!
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015