Top "Pass-by-value" questions

pass-by-value is a "one way passing" so that modifications of the passed value inside the receiving function (or other entity like process, etc) are not returned back.

Confused, whether java uses call by value or call by reference when an object reference is passed?

public class program1{ public static void main(String args[]){ java.util.Vector vc=new java.util.Vector(); vc.add("111"); vc.…

java pass-by-reference pass-by-value
C++ - passing references to std::shared_ptr or boost::shared_ptr

If I have a function that needs to work with a shared_ptr, wouldn't it be more efficient to pass …

c++ boost pass-by-reference pass-by-value shared-ptr
Java - Object state does not change after method call

Beginner java question, but I cannot understand how call-by-Value ( or Reference ) is working in the example below - How come …

java pass-by-reference pass-by-value
C++ pass list as a parameter to a function

I'm trying to build a very simple address book. I created a Contact class and the address book is a …

c++ list pass-by-reference pass-by-value
Does C# pass a List<T> to a method by reference or as a copy?

Taking my first steps in C# world from C/C++, so a bit hazy in details. Classes, as far as …

c# pass-by-reference pass-by-value
Why is 128==128 false but 127==127 is true when comparing Integer wrappers in Java?

class D { public static void main(String args[]) { Integer b2=128; Integer b3=128; System.out.println(b2==b3); } } Output: false class …

java integer comparison pass-by-reference pass-by-value
How do I pass the value (not the reference) of a JS variable to a function?

Here is a simplified version of something I'm trying to run: for (var i = 0; i < results.length; i++) { marker = …

javascript closures pass-by-reference listener pass-by-value
Python : When is a variable passed by reference and when by value?

Possible Duplicate: Python: How do I pass a variable by reference? My code : locs = [ [1], [2] ] for loc in locs: loc = [] print …

python reference pass-by-reference pass-by-value
What is the use of "ref" for reference-type variables in C#?

I understand that if I pass a value-type (int, struct, etc.) as a parameter (without the ref keyword), a copy …

c# parameters pass-by-reference pass-by-value
Is passing pointer argument, pass by value in C++?

Is passing pointer argument, pass by value in C++? Since i see that any change to the pointer as such …

c++ function pointers pass-by-value