calling static methods
Author |
Message |
Master
|
Posted: Wed Mar 03, 2004 12:00 am Post subject: calling static methods |
|
|
How do you call a method like this. What parameter do you use when you call drawH(?, ?)
mine doenst work, no matter what i put.
public static void drawH(Graphics2D g2, Point2D.Double p) |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
wtd
|
Posted: Wed Mar 03, 2004 12:30 am Post subject: (No subject) |
|
|
Exactly what error are you getting?
In Java a static method is called like so:
code: |
ClassTheMethodIsIn.method(params)
|
Rather than:
code: |
object.method(params)
|
|
|
|
|
|
![](images/spacer.gif) |
Master
|
Posted: Wed Mar 03, 2004 12:32 am Post subject: (No subject) |
|
|
ya i know
what parameter do you need for this calling of a static method
drawH(_, _)<-- what is an example of the parameters needed
public static void drawH(Graphics2D g2, Point2D.Double p) |
|
|
|
|
![](images/spacer.gif) |
wtd
|
Posted: Wed Mar 03, 2004 12:51 am Post subject: (No subject) |
|
|
Well, you'd need an object of class Graphics2D and one of Point2D.Double. Go look them up at http://java.sun.com to find out which constructors those classes have. |
|
|
|
|
![](images/spacer.gif) |
Master
|
Posted: Wed Mar 03, 2004 12:53 am Post subject: (No subject) |
|
|
thanks |
|
|
|
|
![](images/spacer.gif) |
|
|