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 5 of 5

Thread: Actual and Formal Parameters

  1. #1
    Junior Member
    Join Date
    Jan 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Actual and Formal Parameters

    I have the following Code


    Which is the Formal Parameter?

    Which is the Actual Parameter?

    Thanks for looking
    Last edited by mikec2500; January 26th, 2011 at 11:56 AM.


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,387
    My Mood
    Hungover
    Thanks
    144
    Thanked 628 Times in 538 Posts

    Default Re: Actual and Formal Parameters

    What do you think? What did google tell you? We aren't just going to do your homework for you.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Junior Member
    Join Date
    Feb 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Re: Actual and Formal Parameters

    actual parameters are the parameters in calling function. and formal parameters are the parameters in called function.
    example:
    class add
    {
    public static void main(String s[])
    {
    int a=5;
    int b=4;
    sum(a,b); // here a and b are actual parameters
    public sum(int c,int d)//here c and are formal parameters
    {
    int s;
    s=c+d;
    system.out.println("the sum is:" &s);
    }
    }}

  4. #4
    Member
    Join Date
    Jul 2010
    Location
    Washington, USA
    Posts
    307
    Thanks
    16
    Thanked 43 Times in 39 Posts

    Default Re: Actual and Formal Parameters

    I learned them as Arguments, and Parameters. Is that incorrect -- a C++ term?

  5. #5
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,387
    My Mood
    Hungover
    Thanks
    144
    Thanked 628 Times in 538 Posts

    Default Re: Actual and Formal Parameters

    Quote Originally Posted by Brt93yoda View Post
    I learned them as Arguments, and Parameters. Is that incorrect -- a C++ term?
    As did I. I don't think it really matters. I've only seen the terms "actual" and "formal" parameters from people on forums looking for homework help. I don't really understand the importance of spending time on this distinction, when I can think of about a hundred other things that would be more important to teach.

    From wikipedia: Many programmers use parameter and argument interchangeably, depending on context to distinguish the meaning. In practice, distinguishing between the two terms is usually unnecessary in order to use them correctly or communicate their use to other programmers. Alternatively, the words actual and formal can be used to distinguish between an argument and a parameter, respectively. For example, the equivalent terms actual argument and actual parameter may be used instead of argument; and formal argument and formal parameter may be used instead of parameter.

    Parameter (computer programming) - Wikipedia, the free encyclopedia
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. formal and actual parameters
    By gemma in forum Java Theory & Questions
    Replies: 3
    Last Post: December 7th, 2010, 10:14 AM
  2. Actual and formal parameters
    By javanoobie in forum Java Theory & Questions
    Replies: 4
    Last Post: December 5th, 2010, 07:29 AM
  3. New to vectors passing parameters
    By osmaavenro in forum What's Wrong With My Code?
    Replies: 3
    Last Post: September 30th, 2010, 04:32 PM
  4. formal Introduction
    By fwashington in forum Member Introductions
    Replies: 1
    Last Post: March 15th, 2010, 09:21 AM
  5. Formal I ntroduction
    By sbliss in forum Member Introductions
    Replies: 5
    Last Post: March 15th, 2010, 09:21 AM