I have the following Code
Which is the Formal Parameter?
Which is the Actual Parameter?
Thanks for looking
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.
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 12:56 PM.
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!
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);
}
}}
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!