🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: aus.computers.java
Article #797

Re: New to Java

#797
From: Alan
Date: Thu, 20 Apr 2000 00:00
42 lines
1454 bytes
g is a variable name, so the method called "paint" is called from another
program
by passing another "Graphics" type

eg

Graphics myG = new Graphics();
paint(myG);

could be a possible way of calling this method the "g" within the method has
a drawString method as g is of type Graphics

eg

Graphics.drawString(jav.util.Stirng, int,int)

exists.

Alan


"David Belavy" <dbelavy@mail.com> wrote in message
news:JfBL4.425$v85.2035@news-server.bigpond.net.au...
> Hello Everyone,
>
> I'm learning to program from the Deitel & Deitel book and I was just
> wondering what the 'g' means in
>
> public void paint (Graphics g)
>     {
>         g.drawString("String", 25,25);
>     }
>
>
> What does the g actually refer to?
>
> Thanks,
>
> David
>
>
Technical Details
Message-ID: <soDL4.9141$5D.20456@ozemail.com.au>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <JfBL4.425$v85.2035@news-server.bigpond.net.au>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d6db,a6c6328d2bd0994c
X-Google-Attributes: gid10d6db,public
From: "Alan" <aboldock@camtech.net.au>
Subject: Re: New to Java
Date: 2000/04/20
Message-ID: <soDL4.9141$5D.20456@ozemail.com.au>
X-Deja-AN: 613571282
Distribution: world
References: <JfBL4.425$v85.2035@news-server.bigpond.net.au>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
X-Trace: ozemail.com.au 956236440 203.38.172.31 (Thu, 20 Apr 2000 23:14:00 EST)
Organization: OzEmail Pty Ltd, Australia
X-MSMail-Priority: Normal
NNTP-Posting-Date: Thu, 20 Apr 2000 23:14:00 EST
Newsgroups: aus.computers.java