• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

to define methods as static or not

 
peter brews
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Following is the program that I wrote for Socket client.
In method2 of the program i am instantiating the class MyClass
and then calling all the methods as <obj>.<methodname> in this method. This method2 will be called with different params .
Could you please advise me if it is possible/better if instead of instatiating the class i make all those methods as static.

(edited by Cindy to format code)
[ April 11, 2002: Message edited by: Cindy Glass ]
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you make them static then you have to watch your synchronization. But WHY would you do either?
If someone called this class, why don't you just use the "this" instance to call the methods?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic