Calling a method without parameters

Discussion in 'Java' started by myklue, Oct 26, 2009.

  1. myklue

    myklue

    Joined:
    Oct 26, 2009
    Messages:
    1
    Likes Received:
    0
    Hi i'm having trouble calling my method in a class. I can't seem to use my tester user input and apply it to the class.

    here is the code from the class:

    Code (Text):
      public int nextNumber()
          {
             if(count < 2)
             {
                count++;
                return 1;
             }
             else
             {
                fnew = fold1 + fold2;
             
                fold2 = fold1;
                fold1 = fnew;
             
                return fnew;
             }
          }
       
     
    and using the method nextNumber() how do I get the user's input to be applied in the method because it doesn't have parameters! I know theres a way I just can't figure it out! Thanks in advance!
     
    myklue, Oct 26, 2009
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jerry051
    Replies:
    2
    Views:
    972
    Oliver Sturm
    Aug 2, 2005
  2. Jabel D. Morales - VMan of Mana

    Problems with JNI: calling a Java method from native method.

    Jabel D. Morales - VMan of Mana, Aug 1, 2003, in forum: Java
    Replies:
    1
    Views:
    5,277
    Joseph Millar
    Aug 1, 2003
  3. rleroux@telus.net
    Replies:
    1
    Views:
    832
    Andrew Thompson
    Jan 28, 2007
  4. sck10
    Replies:
    0
    Views:
    464
    sck10
    Mar 15, 2007
  5. Tinku
    Replies:
    3
    Views:
    1,448
    Alf P. Steinbach
    Jan 31, 2010
  6. Tapio Kelloniemi
    Replies:
    1
    Views:
    194
    ara.t.howard@noaa.gov
    Mar 12, 2007
  7. why-em-jay

    Calling a method of the calling object ...

    why-em-jay, Sep 15, 2005, in forum: Perl Misc
    Replies:
    3
    Views:
    379
    Anno Siegel
    Sep 15, 2005
  8. Matt Gregory
    Replies:
    6
    Views:
    520
    Öö Tiib
    Jun 13, 2014
Loading...