View Single Post
Old 11-04-2003, 04:27 AM   #12 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,166
Belisarius is on a distinguished road
As my professor explained it, if you do this:
Code:
void foo(){
  int a = 4;
  addSix(a);
}

void addSix(int input){
  input = input + 6;
}
"a" will still be 4 after calling addSix() from foo(). But if you do this:

Code:
void foo(){
  Hashtable ht = new Hashtable();
  addSomething(ht);
}

void addSomething(Hashtable input){
  input.put("foo","bar");
}
"ht" will contain "bar" with a key of "foo" after calling addSomething() from foo().
__________________
GitS
Belisarius is offline   Reply With Quote