Pass By ReferencePass by reference or by value?JSON and escaped double quoteApex Test not updating parent object field based on child object formula fieldsAssistance with a Test Class to increase code coverageApex: pass variable by referenceschema.getglobaldescribe needs test classHow to pass a variable's value of child visualforce page to a variable in parent visualforce using jsCode Coverage to Test Custom Object Public ListCannot Return a List of Strings - Void method must not return a valuePass By Reference VS Pass by Value
Is there a public standard for 8 and 10 character grid locators?
Why are C64 games inconsistent with which joystick port they use?
How to make a crossed out leftrightarrow?
What do different value notes on the same line mean?
Crossing US border with music files I'm legally allowed to possess
How were these pictures of spacecraft wind tunnel testing taken?
Full horizontal justification in table
Is the first derivative operation on a signal a causal system?
What is the object moving across the ceiling in this stock footage?
Rotation period of a planet around a star (sun)
Seed ship, unsexed person, cover has golden person attached to ship by umbilical cord
How do you say “buy” in the sense of “believe”?
What is the difference between “/private/var/vm” and “/vm”?
Were pens caps holes designed to prevent death by suffocation if swallowed?
When and what was the first 3D acceleration device ever released?
Under what law can the U.S. arrest International Criminal Court (ICC) judges over war crimes probe?
What is the most important source of natural gas? coal, oil or other?
Rename photos to match video titles
Forward and backward integration -- cause of errors
How does an ARM MCU run faster than the external crystal?
Does this degree 12 genus 1 curve have only one point over infinitely many finite fields?
analysis of BJT PNP type - why they can use voltage divider?
How many chess players are over 2500 Elo?
Infinite Sequence based on Simple Rule
Pass By Reference
Pass by reference or by value?JSON and escaped double quoteApex Test not updating parent object field based on child object formula fieldsAssistance with a Test Class to increase code coverageApex: pass variable by referenceschema.getglobaldescribe needs test classHow to pass a variable's value of child visualforce page to a variable in parent visualforce using jsCode Coverage to Test Custom Object Public ListCannot Return a List of Strings - Void method must not return a valuePass By Reference VS Pass by Value
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
This is a more general computer science question -hope those are ok to ask here.
As a self-taught Salesforce dev I have been trying to work on my core computer science knowledge. I am working on pointers and passing by reference vs value right now.
In the documentation, it says that all primitive values are passed by value. I wrote the following trivial program below to swap integer values and it behaves exactly as I would expect. Inside the function, the values change but the values for the original Integer x and y do not.
Is there a way in Apex to change the value of the original variable? The way you can use an int *
in C?
public with sharing class Swapper
public static void swapInteger(Integer x, Integer y)
Integer tempInteger = x;
x = y;
y = tempInteger;
System.debug('value of x in function ' + x);
System.debug('value of y in function ' + y);
test class
@IsTest
private class Swapper_Test
@IsTest
static void swapTest()
Integer x = 5;
Integer y = 10;
Swapper.swapInteger(x , y);
System.assertEquals(5, y);
System.assertEquals(10, x);
apex
add a comment |
This is a more general computer science question -hope those are ok to ask here.
As a self-taught Salesforce dev I have been trying to work on my core computer science knowledge. I am working on pointers and passing by reference vs value right now.
In the documentation, it says that all primitive values are passed by value. I wrote the following trivial program below to swap integer values and it behaves exactly as I would expect. Inside the function, the values change but the values for the original Integer x and y do not.
Is there a way in Apex to change the value of the original variable? The way you can use an int *
in C?
public with sharing class Swapper
public static void swapInteger(Integer x, Integer y)
Integer tempInteger = x;
x = y;
y = tempInteger;
System.debug('value of x in function ' + x);
System.debug('value of y in function ' + y);
test class
@IsTest
private class Swapper_Test
@IsTest
static void swapTest()
Integer x = 5;
Integer y = 10;
Swapper.swapInteger(x , y);
System.assertEquals(5, y);
System.assertEquals(10, x);
apex
add a comment |
This is a more general computer science question -hope those are ok to ask here.
As a self-taught Salesforce dev I have been trying to work on my core computer science knowledge. I am working on pointers and passing by reference vs value right now.
In the documentation, it says that all primitive values are passed by value. I wrote the following trivial program below to swap integer values and it behaves exactly as I would expect. Inside the function, the values change but the values for the original Integer x and y do not.
Is there a way in Apex to change the value of the original variable? The way you can use an int *
in C?
public with sharing class Swapper
public static void swapInteger(Integer x, Integer y)
Integer tempInteger = x;
x = y;
y = tempInteger;
System.debug('value of x in function ' + x);
System.debug('value of y in function ' + y);
test class
@IsTest
private class Swapper_Test
@IsTest
static void swapTest()
Integer x = 5;
Integer y = 10;
Swapper.swapInteger(x , y);
System.assertEquals(5, y);
System.assertEquals(10, x);
apex
This is a more general computer science question -hope those are ok to ask here.
As a self-taught Salesforce dev I have been trying to work on my core computer science knowledge. I am working on pointers and passing by reference vs value right now.
In the documentation, it says that all primitive values are passed by value. I wrote the following trivial program below to swap integer values and it behaves exactly as I would expect. Inside the function, the values change but the values for the original Integer x and y do not.
Is there a way in Apex to change the value of the original variable? The way you can use an int *
in C?
public with sharing class Swapper
public static void swapInteger(Integer x, Integer y)
Integer tempInteger = x;
x = y;
y = tempInteger;
System.debug('value of x in function ' + x);
System.debug('value of y in function ' + y);
test class
@IsTest
private class Swapper_Test
@IsTest
static void swapTest()
Integer x = 5;
Integer y = 10;
Swapper.swapInteger(x , y);
System.assertEquals(5, y);
System.assertEquals(10, x);
apex
apex
edited May 14 at 11:45
David Reed♦
43.3k82564
43.3k82564
asked May 14 at 11:43
Brooks JohnsonBrooks Johnson
323110
323110
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
In Apex, everything is pass-by-value, and all variables only store references. You might say that parameters are passed by reference-value. This is different than some other languages, where you might pass by reference or by value, and it kind of muddies the waters a bit.
The value of each variable is copied when provided as a parameter, but since Apex only uses references, what you get is a copy of a reference; if the object is not immutable, it can be modified to a new value. The original variable that held the reference, however, cannot be modified by the callee (which is what is typically meant by passing by reference).
All you really need to know is that there's no way to get a reference to a variable directly, you can only get references to objects on the heap. There is no way to write this type of code in Apex without using an object of some sort:
class TwoValues
Integer x, y;
public void swapTwoValues(TwoValues items)
Integer temp = items.y;
items.y = items.x;
items.x = temp;
...
TwoItems item = new TwoItems();
item.x = 5;
item.y = 10;
swapTwoValues(item);
add a comment |
As far as i understand salesforce is based on Java or at least follows the concepts of JAVA and java supports Pass by value.
2nd point is that pass by reference is a complex concept whole concept of salesforce is to focus on less coding means less developer skills so it is not feasible to provide such difficult features.
3rd point is that you are always allowed to create public variable or class level variables which you can access in different methods, hence no need of passing by reference.
add a comment |
A very good example of this topic is provided on the Passing Parameters By Reference and By Value in Apex documentation. Everything in Apex is passed-by-value. The docs mentions as below (emphasis mine):
As described in the new developer’s guide text, Apex is not passing anything by reference. It is passing the reference (i.e., the memory address) by value, which allows the developer to change fields on the object and call methods (like list.add()) on the object
The doc contains example around this.
As an example, in the below class, the two methods reflect this behavior.
public class PassByExample
/**
* this change in the passed list will be always known to the caller
* the memory address was passed-by-value
* the caller will always have the original memory address and thus the values
*/
public static void passByValueChange(List<String> lstString)
lstString.add('This was added in the method');
/**
* this change in the passed list will be NOT known to the caller
* the memory address was passed-by-value; but changed in the method
* the caller will always have the original memory address and NOT the new one
*/
public static void passByValueNoChange(List<String> lstString)
lstString = new List<String>(); // memory address was changed
lstString.add('This was additionally added in the method');
Now, when you test this out:
@isTest static void testPassByValueChange()
List<String> lst = new List<String>();
lst.add('Added from test class');
PassByExample.passByValueChange(lst);
system.debug(lst); // debugs (Added from test class, This was added in the method)
system.assertEquals(2, lst.size());
@isTest static void testPassByValueNoChange()
List<String> lst = new List<String>();
lst.add('Added from test class');
PassByExample.passByValueNoChange(lst);
system.debug(lst); // debugs (Added from test class)
system.assertEquals(1, lst.size());
passByValueNoChange should only show "Added from test class" and size should be 1.
– sfdcfox
May 14 at 16:57
That was a copy paste mistake. And for the size, the snippet was run from the same test method, thus 2.
– Jayant Das
May 14 at 16:59
Fair enough, though the example might cause some confusion. Perhaps make it something a bit more obvious?
– sfdcfox
May 14 at 17:01
Fair point. Updated to reflect different test methods now.
– Jayant Das
May 14 at 17:05
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "459"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f262312%2fpass-by-reference%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
In Apex, everything is pass-by-value, and all variables only store references. You might say that parameters are passed by reference-value. This is different than some other languages, where you might pass by reference or by value, and it kind of muddies the waters a bit.
The value of each variable is copied when provided as a parameter, but since Apex only uses references, what you get is a copy of a reference; if the object is not immutable, it can be modified to a new value. The original variable that held the reference, however, cannot be modified by the callee (which is what is typically meant by passing by reference).
All you really need to know is that there's no way to get a reference to a variable directly, you can only get references to objects on the heap. There is no way to write this type of code in Apex without using an object of some sort:
class TwoValues
Integer x, y;
public void swapTwoValues(TwoValues items)
Integer temp = items.y;
items.y = items.x;
items.x = temp;
...
TwoItems item = new TwoItems();
item.x = 5;
item.y = 10;
swapTwoValues(item);
add a comment |
In Apex, everything is pass-by-value, and all variables only store references. You might say that parameters are passed by reference-value. This is different than some other languages, where you might pass by reference or by value, and it kind of muddies the waters a bit.
The value of each variable is copied when provided as a parameter, but since Apex only uses references, what you get is a copy of a reference; if the object is not immutable, it can be modified to a new value. The original variable that held the reference, however, cannot be modified by the callee (which is what is typically meant by passing by reference).
All you really need to know is that there's no way to get a reference to a variable directly, you can only get references to objects on the heap. There is no way to write this type of code in Apex without using an object of some sort:
class TwoValues
Integer x, y;
public void swapTwoValues(TwoValues items)
Integer temp = items.y;
items.y = items.x;
items.x = temp;
...
TwoItems item = new TwoItems();
item.x = 5;
item.y = 10;
swapTwoValues(item);
add a comment |
In Apex, everything is pass-by-value, and all variables only store references. You might say that parameters are passed by reference-value. This is different than some other languages, where you might pass by reference or by value, and it kind of muddies the waters a bit.
The value of each variable is copied when provided as a parameter, but since Apex only uses references, what you get is a copy of a reference; if the object is not immutable, it can be modified to a new value. The original variable that held the reference, however, cannot be modified by the callee (which is what is typically meant by passing by reference).
All you really need to know is that there's no way to get a reference to a variable directly, you can only get references to objects on the heap. There is no way to write this type of code in Apex without using an object of some sort:
class TwoValues
Integer x, y;
public void swapTwoValues(TwoValues items)
Integer temp = items.y;
items.y = items.x;
items.x = temp;
...
TwoItems item = new TwoItems();
item.x = 5;
item.y = 10;
swapTwoValues(item);
In Apex, everything is pass-by-value, and all variables only store references. You might say that parameters are passed by reference-value. This is different than some other languages, where you might pass by reference or by value, and it kind of muddies the waters a bit.
The value of each variable is copied when provided as a parameter, but since Apex only uses references, what you get is a copy of a reference; if the object is not immutable, it can be modified to a new value. The original variable that held the reference, however, cannot be modified by the callee (which is what is typically meant by passing by reference).
All you really need to know is that there's no way to get a reference to a variable directly, you can only get references to objects on the heap. There is no way to write this type of code in Apex without using an object of some sort:
class TwoValues
Integer x, y;
public void swapTwoValues(TwoValues items)
Integer temp = items.y;
items.y = items.x;
items.x = temp;
...
TwoItems item = new TwoItems();
item.x = 5;
item.y = 10;
swapTwoValues(item);
answered May 14 at 12:21
sfdcfoxsfdcfox
271k13220472
271k13220472
add a comment |
add a comment |
As far as i understand salesforce is based on Java or at least follows the concepts of JAVA and java supports Pass by value.
2nd point is that pass by reference is a complex concept whole concept of salesforce is to focus on less coding means less developer skills so it is not feasible to provide such difficult features.
3rd point is that you are always allowed to create public variable or class level variables which you can access in different methods, hence no need of passing by reference.
add a comment |
As far as i understand salesforce is based on Java or at least follows the concepts of JAVA and java supports Pass by value.
2nd point is that pass by reference is a complex concept whole concept of salesforce is to focus on less coding means less developer skills so it is not feasible to provide such difficult features.
3rd point is that you are always allowed to create public variable or class level variables which you can access in different methods, hence no need of passing by reference.
add a comment |
As far as i understand salesforce is based on Java or at least follows the concepts of JAVA and java supports Pass by value.
2nd point is that pass by reference is a complex concept whole concept of salesforce is to focus on less coding means less developer skills so it is not feasible to provide such difficult features.
3rd point is that you are always allowed to create public variable or class level variables which you can access in different methods, hence no need of passing by reference.
As far as i understand salesforce is based on Java or at least follows the concepts of JAVA and java supports Pass by value.
2nd point is that pass by reference is a complex concept whole concept of salesforce is to focus on less coding means less developer skills so it is not feasible to provide such difficult features.
3rd point is that you are always allowed to create public variable or class level variables which you can access in different methods, hence no need of passing by reference.
answered May 14 at 12:06
Mr.FrodoMr.Frodo
5,20311231
5,20311231
add a comment |
add a comment |
A very good example of this topic is provided on the Passing Parameters By Reference and By Value in Apex documentation. Everything in Apex is passed-by-value. The docs mentions as below (emphasis mine):
As described in the new developer’s guide text, Apex is not passing anything by reference. It is passing the reference (i.e., the memory address) by value, which allows the developer to change fields on the object and call methods (like list.add()) on the object
The doc contains example around this.
As an example, in the below class, the two methods reflect this behavior.
public class PassByExample
/**
* this change in the passed list will be always known to the caller
* the memory address was passed-by-value
* the caller will always have the original memory address and thus the values
*/
public static void passByValueChange(List<String> lstString)
lstString.add('This was added in the method');
/**
* this change in the passed list will be NOT known to the caller
* the memory address was passed-by-value; but changed in the method
* the caller will always have the original memory address and NOT the new one
*/
public static void passByValueNoChange(List<String> lstString)
lstString = new List<String>(); // memory address was changed
lstString.add('This was additionally added in the method');
Now, when you test this out:
@isTest static void testPassByValueChange()
List<String> lst = new List<String>();
lst.add('Added from test class');
PassByExample.passByValueChange(lst);
system.debug(lst); // debugs (Added from test class, This was added in the method)
system.assertEquals(2, lst.size());
@isTest static void testPassByValueNoChange()
List<String> lst = new List<String>();
lst.add('Added from test class');
PassByExample.passByValueNoChange(lst);
system.debug(lst); // debugs (Added from test class)
system.assertEquals(1, lst.size());
passByValueNoChange should only show "Added from test class" and size should be 1.
– sfdcfox
May 14 at 16:57
That was a copy paste mistake. And for the size, the snippet was run from the same test method, thus 2.
– Jayant Das
May 14 at 16:59
Fair enough, though the example might cause some confusion. Perhaps make it something a bit more obvious?
– sfdcfox
May 14 at 17:01
Fair point. Updated to reflect different test methods now.
– Jayant Das
May 14 at 17:05
add a comment |
A very good example of this topic is provided on the Passing Parameters By Reference and By Value in Apex documentation. Everything in Apex is passed-by-value. The docs mentions as below (emphasis mine):
As described in the new developer’s guide text, Apex is not passing anything by reference. It is passing the reference (i.e., the memory address) by value, which allows the developer to change fields on the object and call methods (like list.add()) on the object
The doc contains example around this.
As an example, in the below class, the two methods reflect this behavior.
public class PassByExample
/**
* this change in the passed list will be always known to the caller
* the memory address was passed-by-value
* the caller will always have the original memory address and thus the values
*/
public static void passByValueChange(List<String> lstString)
lstString.add('This was added in the method');
/**
* this change in the passed list will be NOT known to the caller
* the memory address was passed-by-value; but changed in the method
* the caller will always have the original memory address and NOT the new one
*/
public static void passByValueNoChange(List<String> lstString)
lstString = new List<String>(); // memory address was changed
lstString.add('This was additionally added in the method');
Now, when you test this out:
@isTest static void testPassByValueChange()
List<String> lst = new List<String>();
lst.add('Added from test class');
PassByExample.passByValueChange(lst);
system.debug(lst); // debugs (Added from test class, This was added in the method)
system.assertEquals(2, lst.size());
@isTest static void testPassByValueNoChange()
List<String> lst = new List<String>();
lst.add('Added from test class');
PassByExample.passByValueNoChange(lst);
system.debug(lst); // debugs (Added from test class)
system.assertEquals(1, lst.size());
passByValueNoChange should only show "Added from test class" and size should be 1.
– sfdcfox
May 14 at 16:57
That was a copy paste mistake. And for the size, the snippet was run from the same test method, thus 2.
– Jayant Das
May 14 at 16:59
Fair enough, though the example might cause some confusion. Perhaps make it something a bit more obvious?
– sfdcfox
May 14 at 17:01
Fair point. Updated to reflect different test methods now.
– Jayant Das
May 14 at 17:05
add a comment |
A very good example of this topic is provided on the Passing Parameters By Reference and By Value in Apex documentation. Everything in Apex is passed-by-value. The docs mentions as below (emphasis mine):
As described in the new developer’s guide text, Apex is not passing anything by reference. It is passing the reference (i.e., the memory address) by value, which allows the developer to change fields on the object and call methods (like list.add()) on the object
The doc contains example around this.
As an example, in the below class, the two methods reflect this behavior.
public class PassByExample
/**
* this change in the passed list will be always known to the caller
* the memory address was passed-by-value
* the caller will always have the original memory address and thus the values
*/
public static void passByValueChange(List<String> lstString)
lstString.add('This was added in the method');
/**
* this change in the passed list will be NOT known to the caller
* the memory address was passed-by-value; but changed in the method
* the caller will always have the original memory address and NOT the new one
*/
public static void passByValueNoChange(List<String> lstString)
lstString = new List<String>(); // memory address was changed
lstString.add('This was additionally added in the method');
Now, when you test this out:
@isTest static void testPassByValueChange()
List<String> lst = new List<String>();
lst.add('Added from test class');
PassByExample.passByValueChange(lst);
system.debug(lst); // debugs (Added from test class, This was added in the method)
system.assertEquals(2, lst.size());
@isTest static void testPassByValueNoChange()
List<String> lst = new List<String>();
lst.add('Added from test class');
PassByExample.passByValueNoChange(lst);
system.debug(lst); // debugs (Added from test class)
system.assertEquals(1, lst.size());
A very good example of this topic is provided on the Passing Parameters By Reference and By Value in Apex documentation. Everything in Apex is passed-by-value. The docs mentions as below (emphasis mine):
As described in the new developer’s guide text, Apex is not passing anything by reference. It is passing the reference (i.e., the memory address) by value, which allows the developer to change fields on the object and call methods (like list.add()) on the object
The doc contains example around this.
As an example, in the below class, the two methods reflect this behavior.
public class PassByExample
/**
* this change in the passed list will be always known to the caller
* the memory address was passed-by-value
* the caller will always have the original memory address and thus the values
*/
public static void passByValueChange(List<String> lstString)
lstString.add('This was added in the method');
/**
* this change in the passed list will be NOT known to the caller
* the memory address was passed-by-value; but changed in the method
* the caller will always have the original memory address and NOT the new one
*/
public static void passByValueNoChange(List<String> lstString)
lstString = new List<String>(); // memory address was changed
lstString.add('This was additionally added in the method');
Now, when you test this out:
@isTest static void testPassByValueChange()
List<String> lst = new List<String>();
lst.add('Added from test class');
PassByExample.passByValueChange(lst);
system.debug(lst); // debugs (Added from test class, This was added in the method)
system.assertEquals(2, lst.size());
@isTest static void testPassByValueNoChange()
List<String> lst = new List<String>();
lst.add('Added from test class');
PassByExample.passByValueNoChange(lst);
system.debug(lst); // debugs (Added from test class)
system.assertEquals(1, lst.size());
edited May 14 at 17:05
answered May 14 at 13:00
Jayant DasJayant Das
21.8k21433
21.8k21433
passByValueNoChange should only show "Added from test class" and size should be 1.
– sfdcfox
May 14 at 16:57
That was a copy paste mistake. And for the size, the snippet was run from the same test method, thus 2.
– Jayant Das
May 14 at 16:59
Fair enough, though the example might cause some confusion. Perhaps make it something a bit more obvious?
– sfdcfox
May 14 at 17:01
Fair point. Updated to reflect different test methods now.
– Jayant Das
May 14 at 17:05
add a comment |
passByValueNoChange should only show "Added from test class" and size should be 1.
– sfdcfox
May 14 at 16:57
That was a copy paste mistake. And for the size, the snippet was run from the same test method, thus 2.
– Jayant Das
May 14 at 16:59
Fair enough, though the example might cause some confusion. Perhaps make it something a bit more obvious?
– sfdcfox
May 14 at 17:01
Fair point. Updated to reflect different test methods now.
– Jayant Das
May 14 at 17:05
passByValueNoChange should only show "Added from test class" and size should be 1.
– sfdcfox
May 14 at 16:57
passByValueNoChange should only show "Added from test class" and size should be 1.
– sfdcfox
May 14 at 16:57
That was a copy paste mistake. And for the size, the snippet was run from the same test method, thus 2.
– Jayant Das
May 14 at 16:59
That was a copy paste mistake. And for the size, the snippet was run from the same test method, thus 2.
– Jayant Das
May 14 at 16:59
Fair enough, though the example might cause some confusion. Perhaps make it something a bit more obvious?
– sfdcfox
May 14 at 17:01
Fair enough, though the example might cause some confusion. Perhaps make it something a bit more obvious?
– sfdcfox
May 14 at 17:01
Fair point. Updated to reflect different test methods now.
– Jayant Das
May 14 at 17:05
Fair point. Updated to reflect different test methods now.
– Jayant Das
May 14 at 17:05
add a comment |
Thanks for contributing an answer to Salesforce Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f262312%2fpass-by-reference%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown