Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Does this create another instance ?  RSS feed

 
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
Sheriff
Posts: 37242
519
Eclipse IDE Java VI Editor
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!