File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Parameters and Arguments of a method. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Parameters and Arguments of a method." Watch "Parameters and Arguments of a method." New topic

Parameters and Arguments of a method.

Sunali Anu

Joined: Jun 04, 2007
Posts: 14
I want to know the difference between the two. If some body could please help me with this.. Thanks.
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199


Welcome to JavaRanch!

Most people use these two terms interchangeably, but there's a subtle difference in meaning. If you have a method like this:

then "x" is a parameter to the method. It's the variable listed in the declaration; whereas if you call the method like this

then "3" is an argument to the method call; it's the actual value passed in.

[Jess in Action][AskingGoodQuestions]
Bill Cruise
Ranch Hand

Joined: Jun 01, 2007
Posts: 148
They're used interchangably in a lot of instances but here's the difference. When you define a method (or function), you give it a parameter. When you call the method you pass it an argument.

Here param is a parameter.

Here 5 is the argument being passed.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I have sometimes seen Formal Parameter refer to the declaration, and Actual Parameter refer to the value passed.

There is just enough variety in usage to confuse us thoroughly. As long as a speaker or writer uses them consistently you can usually figger out what they mean sooner or later.

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
I agree. Here's the link:
subject: Parameters and Arguments of a method.
jQuery in Action, 3rd edition