Home > DeveloperSection > Interviews > How many ways can an argument be passed to a subroutine and explain them?

Posted on    March-28-2011 5:20 AM

 Java Java 
 1 Answer(s)
  779  View(s)
Rate this:

Amit Singh

Total Post:565

Posted on    March-28-2011 12:00 AM

An argument can be passed in two ways:
  1. passing by value
  2. passing by reference.
Passing by value: This method copies the value of an argument into the formal parameter of the subroutine.
Passing by reference: In this method, a reference to an argument (not the value of the argument) is passed to the parameter.

Don't want to miss updates? Please click the below button!

Follow MindStick