Skip to main content

Parameter vs Argument

The parameter is the local variable in the method and the argument is the caller-supplied value/reference.

In the given example, the parameter for doSomething is 'a' and the argument is 22.

public static void doSomething(int a)
{
System.out.println("The argument was " + a);
}

public static void main(String[] s)
{
doSomething(22);
}

Comments

Popular posts from this blog

SVN red book

I normally use Subclipse plugin for Eclipse for SVN operations. It really makes life easy. I am a novice when it comes to performing svn operations using SVN commands. I found a very useful resource for that: HTML version of SVN red book (for subversion 1.5) Hope you find this useful :)

JAR file

The JAR file format is based on the popular ZIP file format, and is used for aggregating many files into one. Unlike ZIP files, JAR files are used not only for archiving and distribution, but also for deployment and encapsulation of libraries, components, and plug-ins, and are consumed directly by tools such as compilers and JVMs. Special files contained in the JAR, such as manifests and deployment descriptors, instruct tools how a particular JAR is to be treated. A JAR file might be used: * For distributing and using class libraries * As building blocks for applications and extensions * As deployment units for components, applets, or plug-ins * For packaging auxiliary resources associated with components