• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I would like to place a "CallingMethod" inside of an " if " loop

 
lyn flick
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to use a "CallingMethod" inside of an " if " loop in order to access and execute a different .class. Is this possible, if so could you give me a simple example code??
 
Campbell Ritchie
Sheriff
Posts: 48382
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's a CallingMethod? Do you mean you want to invoke a method?
 
fred rosenberger
lowercase baba
Bartender
Posts: 12084
29
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you be more clear on what you mean? what is a "CallingMethod"? also, you don't execute a classs... you can execute methods of a class, if that's what you mean. If they are static, you can simply call them. If not, you need a reference to the object.
 
Campbell Ritchie
Sheriff
Posts: 48382
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tested the code in the previous post, but not this most recent class.
 
Campbell Ritchie
Sheriff
Posts: 48382
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Beat you by 21 seconds, Fred. That's almost up to Rob's standard.
 
Campbell Ritchie
Sheriff
Posts: 48382
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't call them if loops. Let's change the last lot of code.That will randomly show the output or not show it with a 50/50 probability. Again code not tested.
 
lyn flick
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay guys...
I am working on a mortgage calculator for class. I have all of the basic requirements for this week, however I don't care for the way it looks. As it stands right now I have a drop down menu which allows the end user to select a predefined terms combo or select own terms combo. This drop down menu is processed through an Array. The 5th index position is where I would like to call a method from another .class and have this particular if statement process the "own terms" selection. I hope that makes a little more sense!


PS. Is there a way to respond to each of you without submitting a reply to the original post?

Thanks for all the help!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All responses should be posted as replies to this post.
 
Campbell Ritchie
Sheriff
Posts: 48382
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't understand the problem. Sorry. What is the difference between element 5 and the others? How can you call something on element 5 and not on the others?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic