Linked Questions
10 questions linked to/from Java, pass-by-value, reference variables
-1 votes
5 answers
439 views
Java Pass by value [duplicate]
Possible Duplicate: Java, pass-by-value, reference variables Consider the following simple java program class main{ public static void main(String args[]){ int x = 5; ...
0 votes
2 answers
171 views
Pass by value - tree not deleted [duplicate]
Possible Duplicate: Java, pass-by-value, reference variables I am a bit confused on how exactly JAVA pass by value works with object. For e.g. if I pass a object as a parameter to the method. I ...
52 votes
9 answers
40k views
Are structs 'pass-by-value'?
I've recently tried to create a property for a Vector2 field, just to realize that it doesn't work as intended. public Vector2 Position { get; set; } this prevents me from changing the values of its ...
10 votes
4 answers
12k views
Does Java pass by reference? [duplicate]
Does Java really support passing by reference? If it doesn't, why do we have the == operator for finding two objects with the same reference?
4 votes
4 answers
17k views
Object reference in java
consider this simple servlet sample: protected void doGet(HttpServletRequest request, HttpServletResponse response){ Cookie cookie = request.getCookie(); // do weird stuff with cookie object }...
0 votes
2 answers
6k views
java: pass-by-value or pass-by-reference [duplicate]
I'd two code snippets: First class PassByTest{ public static void main(String... args){ PassByTest pbt=new PassByTest(); int x=10; System.out.println("x= "+x); ...
2 votes
2 answers
8k views
Best practice for modifying object reference values in Java?
I am fairly new to Java, and recently I was reading some material about Java being pass-by-value. I've read over this question, and this blog before running a test myself. Now, based on my reading ...
0 votes
4 answers
517 views
In java are the parameters passed by reference or by value [duplicate]
Possible Duplicate: Is Java pass by reference? In java are the parameters passed by reference or by value
2 votes
2 answers
3k views
void foo(int &x) -> Ruby? Passing integers by reference?
as a way to spice up my C++ programming homework, I've decided to instead of typing the C++ from the book onto my computer, instead reforming it in Ruby. Yes it's a bit silly, but I'm bored. Anyway, ...
1 vote
3 answers
3k views
Variable scope with a method in Java
I thought I understood variable scope until I came across this bit of code: private static void someMethod(int i, Account a) { i++; a.deposit(5); a = new Account(80); } int score = 10; Account ...