• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Does this create another instance ?

 
Steve Yu
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public class Test {
public void doAct1() {
ClassOne one = new ClassOne();
doAct2(one, ...);
}
public void doAct2(ClassOne classOne, ..) {
classOne.doSomething(..);
}
}
Question --- in method "doAct2", the parameter "classOne" is just another reference to the instance "one" created in method "doAct1", right ? In other words, the pgm doesn't create another instance of "ClassOne" in "doAct2" method, right ?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34870
369
Eclipse IDE Java VI Editor
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic