Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calling methods from main method

 
Tammy Kline
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, say I have 3 methods:



How do I call methods "metOne" and "metTwo" from the main method?? All of the information I can find on it is just confusing me even more.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As both methods are static, you can just call them, and get the returned value


Note the "For (int x = 0; x > 5; x--)" is not going to lead you anywhere
 
Tammy Kline
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Satou kurinosuke:
[QB]As both methods are static, you can just call them, and get the returned value



I just tried plugging that into my real code and it gave me an error saying . <sigh> this is absolutely frustrating. Thanks anyway!
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You aren't showing us the code so we don't know where it is.

But that message tells you that you are trying to call a method that expects an int parameter and aren't sending any.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://faq.javaranch.com/view?AvoidRedHerrings

<sigh> this is absolutely frustrating

That would be less frustrating if you'd show us the real problem. Your first post shows a methods with no parameters, whereas your compile error indicates that you are trying to call a method you has a parameter. It will be difficult to help if you don't post your real problem.
[ April 22, 2007: Message edited by: Satou kurinosuke ]
 
Tammy Kline
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Satou kurinosuke:
http://faq.javaranch.com/view?AvoidRedHerrings


Sorry ... I knew it was a big no-no to repost something already posted but in my ... tiredness, frustration, add whatever word you like here ... to figure this out, I posted a new question instead of adding to my already posted question which would've made more sense.

I'll consider my hand slapped and make sure not to do this again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic