Back to Browse

Call By Value and Call By Reference in Java Programming Language

44 views
Jul 5, 2021
16:07

Call by value method of passing arguments to a method copies the actual value of an argument into the formal parameter of the function, that time not swap two integer number because of in main variable and function variables different location. In method of swap here example that swap two number but cursor return back in main method class that time argument x and y variable not swap. Call by reference method of passing arguments to a method copies the reference of an argument into the formal parameter. In this method use the pointer variable to swap two integer numbers.Inside the method, the reference is used to access the actual argument used in the call. This means that changes made to in this technique and swap the two in main method variable.

Download

0 formats

No download links available.

Call By Value and Call By Reference in Java Programming Language | NatokHD