• Post Reply Bookmark Topic Watch Topic
  • New Topic

Calling method in Main  RSS feed

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I have class myClass like this....




How would I call myMethod() in Main? Should I create object first and then call it by object.myMethod() or should I call it myClass.myMethod()?




 
Bartender
Posts: 1664
37
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Edited your post to fix your code tags.

Yes, you would need to create an object to call its method.
 
Stribor Kab
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
salvin francis wrote:Edited your post to fix your code tags.

Yes, you would need to create an object to call its method.


Where did you click to edit the post. I wanted to do that and couldnt find edit option?
 
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stribor Kab wrote:
Where did you click to edit the post. I wanted to do that and couldnt find edit option?


Salvin is a moderator. As such, he can edit all posts -- including yours.  For non-moderators, the rule is somewhat in flux, unfortunately. Currently, I believe the rule is, when you earned five cows, you can edit your own posts, provided that it hasn't been responded to yet.

Henry
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!