g.drawRect(10, 20, 30, 40);
This calls the drawRect method in the class of g (Graphics) with 4 int parameters. Internally there are five parameters: the Graphics object, and the four int parameters. The method can then reference all of the fields in the Graphics object without any special notation. this. in front of them to make it clear that you are calling the method with the current object. [needs examples]