Thread: Arguments
View Single Post
  #8 (permalink)  
Old 08-21-2006, 03:38 PM
amac amac is offline
Newbie
 
Join Date: Aug 2006
Posts: 8
Credits: 0
Rep Power: 0
amac is on a distinguished road
Default

Quote:
Originally Posted by Sionofdarkness View Post
A little. How about giving me one of those examples? Those always seem to help a lot.
Arguments are what you give to functions. For example

Code:
void printFunction(String argument){
 System.out.println(argument);
}
This is a method which prints out the argument. To call it, another method would have the following code:

Code:
String data = "hello world";
printFunction(data);
Here you can see that the code passes in a string that contains "hello world", meaning that when the printFunction method is executed argument="hello world".

The talk of nested function calls isn't really important. it would just be, for example, printFunction having the following code:
Code:
void printFunction(String argument){
 
  printWord(argument);
}
In that case the printFunction function is called, and it in turn calls another function 'printWord' with its own argument. So it passes "hello world" onto printWord.
Reply With Quote