A constructor is a special method called to construct an instance of a class. It has the same name as the class, and no return type declaration
/** initialise myself; in addition to the things hands have
* generically, I have a radius */
Again, a 'javadoc' comment. This one documents this constructor.
public BlobHand( int l, HandDriver d, int r)
This constructor takes three arguments, respectively an
int, a HandDriver, and another
int. An int is a primitive data type
which is not an object; a HandDriver is an object
whose class is either HandDriver or some subclass of
HandDriver
{
super( l, d);
The first thing this constructor does is to pass it's first two arguments 'up the tree' to its superclass's constructor, which knows how to deal with them.
radius = r;
}
The superclass doesn't have a radius, so it can't know how to deal with it. So initialise it here.
give me feedback on this page // show previous feedback on this page