Calling a method without parameters

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

  1. myklue

    myklue

    Joined:
    Oct 26, 2009
    Messages:
    1
    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:
      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. Advertising

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:
    802
    Oliver Sturm
    Aug 2, 2005
  2. Tinku
    Replies:
    3
    Views:
    1,220
    Alf P. Steinbach
    Jan 31, 2010
  3. Tapio Kelloniemi
    Replies:
    1
    Views:
    133
    ara.t.howard@noaa.gov
    Mar 12, 2007
  4. why-em-jay

    Calling a method of the calling object ...

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

Share This Page