Java and Database Connectivity
|
A bit about syntax: declaring a method
/** just a blob round my end position */
public void paint( Graphics g)
{
g.setColor( colour);
g.fillOval( end.x - radius, end.y - radius,
2 * radius, 2 * radius);
}
-
Methods are the way we describe the behaviour of objects.
Here is a methd called
paint which describes
how a BlobHand paints itself on a
Graphics object.
-
It calls a method
setColor of the
Graphics object to set the colour it wants.
-
It calls a method
fillOval of the
Graphics object to draw a filled circle at its
end position
-
public means that any other object can call
this method
-
void means that this method doesn't return any
value