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;








3















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);











share|improve this question






























    3















    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);











    share|improve this question


























      3












      3








      3








      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);











      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 14 at 11:45









      David Reed

      43.3k82564




      43.3k82564










      asked May 14 at 11:43









      Brooks JohnsonBrooks Johnson

      323110




      323110




















          3 Answers
          3






          active

          oldest

          votes


















          3














          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);





          share|improve this answer






























            3














            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.






            share|improve this answer






























              1














              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());






              share|improve this answer

























              • 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











              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
              );



              );













              draft saved

              draft discarded


















              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









              3














              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);





              share|improve this answer



























                3














                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);





                share|improve this answer

























                  3












                  3








                  3







                  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);





                  share|improve this answer













                  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);






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered May 14 at 12:21









                  sfdcfoxsfdcfox

                  271k13220472




                  271k13220472























                      3














                      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.






                      share|improve this answer



























                        3














                        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.






                        share|improve this answer

























                          3












                          3








                          3







                          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.






                          share|improve this answer













                          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.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered May 14 at 12:06









                          Mr.FrodoMr.Frodo

                          5,20311231




                          5,20311231





















                              1














                              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());






                              share|improve this answer

























                              • 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















                              1














                              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());






                              share|improve this answer

























                              • 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













                              1












                              1








                              1







                              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());






                              share|improve this answer















                              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());







                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              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

















                              • 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

















                              draft saved

                              draft discarded
















































                              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.




                              draft saved


                              draft discarded














                              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





















































                              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







                              Popular posts from this blog

                              Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

                              Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

                              Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020