File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30405
    
150

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
 
Consider Paul's rocket mass heater.
 
subject: Does this create another instance ?