Hi, i have been proramming for about 2 weks know but only just realised that a procedure call and a procedure decleration are not the same thing. could someone please explain the diffrence?
thanks =)
Printable View
Hi, i have been proramming for about 2 weks know but only just realised that a procedure call and a procedure decleration are not the same thing. could someone please explain the diffrence?
thanks =)
When you declare the method/procedure, you do something like this:
From another method, you can call this:Code:public void thisIsAMethod() {
//Some code
}
(This is also called invoking, if you want to know some other terms used.)Code:someClass.thisIsAMethod();
oh okay thanks, do you think this analogy makes sense? : declaring a method is like mixing flour and eggs to make a cake for a TV show, and calling a method is like saying "here is one i made earlier" and taking out an old mix that has already been made.
its just i find it much easier to learn and explain this stuff if it has nothing to do with programs as suck but is more like a real life situation.
No. Declaring a method is more like writing down the recipe and calling it actually putting that recipe to use.