Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    As a side note - the method that calculates the factorial should only need one input parameter - get rid of the first parameter and initialize it in the method. Commented Feb 16, 2012 at 23:48
  • @MichaelBurr That should be done, as right now fact is not reset between loops. Keep in mind that fact has to be declared in the calculator method long fact=1; as well as in main(). Commented Feb 16, 2012 at 23:53
  • a static method can invoke only another static methods from the same class. Your main method is static, so if you want to call calculator it must be static too. You can refer to the static keyword here or to this post. Commented Feb 16, 2012 at 23:59
  • @LuiggiMendoza Thank you for the links. I have to revisit them but what I read was a little more helpful than what I was reading from. Commented Feb 17, 2012 at 1:28
  • @JeremyBorton sure just google java static keyword and there will be tons of info for you. Maybe you want to learn more of Java keywords and their use :D. Commented Feb 17, 2012 at 2:59