"pass argument:what does it mean?" can you pls read and give me some feedback
hey guys i have written this very small paper aimed at a beginner programmer. what is meant to do is make a novice be able to understand what it mean to pass a arguement to a method. if you have a read and just give me a bit of feedback it would be very helpful. please if you see any spelling or grammar mistakes please let me know also. its only one page, so it shouldnt take you more than 10 mins =) thanks to anyone who does. i have uploaded it to sendspace, its really sall in size. if you want i can post it straight on here.
heres the file Download What does it mean to pass an argument to a method.docx from Sendspace.com - send big files the easy way
EDIT: im posting it here directly
What does it mean to pass an argument to a method?
To be able to understand what it means to pass an argument to a method, first it must be known what arguments and methods actually are.
A method can be thought of in a variety of ways. In everyday life situations “methods” can be seen everywhere. One way to think about it is in televisions. If you think of a method as “what a program can do” then to call a method is to give an instruction. In the case of Televisions it has methods for how high the volume is, what channel to play etc. When a channel is selected, the number on which it is situated tells the TV which channel to play. The number is therefore an argument and so selecting the number is passing the argument. From this it can be seen that a method is what a program can do, and an argument is the actual value that is passed in when the method is called. 1
Now if thought about in programming terms, using the following example, it can be explained what passing an argument to a method means. Here is a very simple program.
public static void main (String param)
public static void Question()
System.out.println("Hello there, how are you?");
} // ends question
} // ends class Howareyou
In this case the method, System.out.println is an instruction to print something to the console, and it has been given the parameter of “string” by the line,(String param). However as a method this is only what the program can do. It doesn’t give it anything to actually print. That is provided by the argument, which comes after the method in the brackets.
In the above example we can see that to pass an argument is to call a method with parameters that need to be given values. Passing the argument is taking what is inside the brackets (“Hello there, how are you?) And giving it to the instruction, System.out.println as what to do. Therefore if the example was actually run it would print the words “Hello there, how are you?”.