Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Question to do with methods.

  1. #1
    Junior Member Dragonkndr712's Avatar
    Join Date
    Jan 2011
    Location
    Texas
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Question to do with methods.

    How would you call something from one method to another? More specific how would you call an answer to a question from one method to use in another method?


  2. #2
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: Question to do with methods.

    Function Definition: int x(int);
    Function Call from anywhere: x(5);
    Function Implementation:
    int x(int a)
    {
     return a;
    }

  3. #3
    Junior Member Dragonkndr712's Avatar
    Join Date
    Jan 2011
    Location
    Texas
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Question to do with methods.

    Could you explain a little more. I am a newbie and I dont quite understand what you mean.

  4. #4
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: Question to do with methods.

    I'll recommend you to read this

Similar Threads

  1. I need help with METHODS!!!
    By Slone in forum What's Wrong With My Code?
    Replies: 2
    Last Post: December 14th, 2010, 08:33 AM
  2. newbie question about Abstract methods
    By FailMouse in forum Java Theory & Questions
    Replies: 3
    Last Post: August 10th, 2010, 11:51 PM
  3. methods help
    By hockey87 in forum AWT / Java Swing
    Replies: 1
    Last Post: March 9th, 2010, 11:57 PM
  4. Re-using methods?
    By Morevan in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 26th, 2010, 05:04 PM
  5. A question about inherited methods
    By joachim89 in forum Object Oriented Programming
    Replies: 1
    Last Post: January 12th, 2010, 09:06 PM