Sunday, November 8, 2009

WHAT IS ARGUMENT

An argument given in the method, can take input through the argument list.

For example,

public int add(int x,int y)

public specifies the access modifier.
int specifies that the return type of this add method is an integer.
It is not necessary that it must be integer, as the parameter is given as int x, int y and it can be any of the data type. Where as we can determine what type it should return by proper conversion.
int x, int y are the arguments of this method.

No comments:

Post a Comment