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

Posted on    October-25-2010 12:00 AM

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

Pushpendra Singh

Total Post:241

Posted on    November-08-2010 1:00 AM

An argument can be passed in two ways. They are passing by value and 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