Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 calling static methods
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Master




PostPosted: 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)
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: 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)
Master




PostPosted: 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)
wtd




PostPosted: 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.
Master




PostPosted: Wed Mar 03, 2004 12:53 am   Post subject: (No subject)

thanks
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: