jQuery in Action, 3rd edition
The moose likes Beginning Java and the fly likes parameter and arguments Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "parameter and arguments" Watch "parameter and arguments" New topic

parameter and arguments

Mathew Lee
Ranch Hand

Joined: Jun 08, 2009
Posts: 238
>>> Note: Parameters refers to the list of variables in a method declaration. Arguments are the actual values that are passed in when the method is invoked. When you invoke a method, the arguments used must match the declaration's parameters in type and order.

I was reading above lines from link

I have not clearly understood the difference between parameter and argument

Any ideas, resources,sample code,links, highly appreciated. thanks in advance.
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 44472
public void foo (int i) { ... }       Here i is a parameter

foo(123);       Here i is passed as an argument
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14991

The words "parameter" and "argument" are also often used for the same thing. There is no really meaningful difference.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
It is sorta covered in the JavaRanch Style Guide.
subject: parameter and arguments
It's not a secret anymore!