aspose file tools*
The moose likes Beginning Java and the fly likes Does this create another instance ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Does this create another instance ?" Watch "Does this create another instance ?" New topic
Author

Does this create another instance ?

Steve Yu
Ranch Hand

Joined: Mar 26, 2003
Posts: 60
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

Joined: May 26, 2003
Posts: 31057
    
232

Yes, that is correct.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Does this create another instance ?