Linked Questions

-1 votes
5 answers
439 views

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; ...
nikhil's user avatar
  • 9,423
0 votes
2 answers
171 views

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 ...
ASingh's user avatar
  • 485
52 votes
9 answers
40k views

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 ...
Acidic's user avatar
  • 6,350
10 votes
4 answers
12k views

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?
user avatar
4 votes
4 answers
17k views

consider this simple servlet sample: protected void doGet(HttpServletRequest request, HttpServletResponse response){ Cookie cookie = request.getCookie(); // do weird stuff with cookie object }...
allan's user avatar
  • 29
0 votes
2 answers
6k views

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); ...
Mohammad Faisal's user avatar
2 votes
2 answers
8k views

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 ...
etech's user avatar
  • 2,821
0 votes
4 answers
517 views

Possible Duplicate: Is Java pass by reference? In java are the parameters passed by reference or by value
billu's user avatar
  • 2,573
2 votes
2 answers
3k views

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, ...
Earlz's user avatar
  • 64.3k
1 vote
3 answers
3k views

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 ...
Devoted's user avatar
  • 185k