This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
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

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Does this create another instance ?" Watch "Does this create another instance ?" New topic

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, ..) {
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

Joined: May 26, 2003
Posts: 30580

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
GeeCON Prague 2014
subject: Does this create another instance ?