Avatar of dpalyca755
dpalyca755
 asked on

passing objects

If I instantiate an object in my application's main class, and then pass it to the constructor of another class which will need to use it, does the copy/assignment of the object to something local actually make another object?
Generic example below:
Class A {
ClassB B = new ClassB();
ClassC C = new ClassC(B);
}

Class C {
ClassB localB = null;
Class C (ClassB B) {
  localB = B;
}
}
Java

Avatar of undefined
Last Comment
nareshvoota

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
nareshvoota

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23