Showing posts with label call by value. Show all posts
Showing posts with label call by value. Show all posts

Monday, 20 January 2014

A CLOSER LOOK AT ARGUMENT PASSING

There are two ways that a computer language can pass an argument to a subroutine. The first way is call-by-value.This method copies the value of an argument into the formal parameter of the subroutine. Therefore, changes made to the parameter of the subroutine have no effect on the argument. The second way an argument can be passed is call-by-reference. In Java, when you pass a simple type to a method, it is passed by value. Thus, what occurs to the parameter that receives the argument has no effect outside the method.