aspose file tools*
The moose likes Beginning Java and the fly likes Formal and Actual parameter. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Formal and Actual parameter." Watch "Formal and Actual parameter." New topic
Author

Formal and Actual parameter.

sharma anurag
Greenhorn

Joined: Aug 29, 2007
Posts: 16
Hi to all my friends of javaranch.!!!
I want to know what is the basic diffrence between formal and actual parameter?
Thanks in advance.!!! :roll:
Vassili Vladimir
Ranch Hand

Joined: Mar 08, 2007
Posts: 1585
Hi,

suppose that you have the following code snippet :



From the code snippet above, the value 1 passed from the main method to the doIt() method is the actual parameter, and the toDo parameter in the doIt() mrthod is the formal parameter, sometimes it's also called the dummy parameter.

I hope that this was helpful to you ...

Best of luck ...


Vassili ...
SCJP 5.0, SCWCD 1.4, SCJA 1.0
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

When its time to *actually* pass the argument, whatever you pass at runtime is called as Actual Argument.

Whereas, the argument which is received to get the passed argument is called Formal Argument.

Does that help you?


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Note that one reply above used "parameter" and the other used "argument" for both actual and formal. Google up on the terms and see if you think either or both were correct. Sometimes you'll see parameter used for the formal and argument used for the actual.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

The distinction is arguably subtle (no pun intended), and I have to admit I'm not as careful with these words as I should be. Interestingly, Wikipedia redirects "argument" to the entry for "parameter," which discusses both words.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

That's an interesting point you have noted Stan James.

Thanks for the updates with wikipedia link Marc.

Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

Based on my inferences, i also feel that "parameter" is what you declare in the function prototype and "argument" is the value what you actually pass at runtime.

But as marc said, many people tend to use these terms interchangably.
[ September 03, 2007: Message edited by: Raghavan Muthu ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Formal and Actual parameter.