Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Passing Object to Constructor - Is this object creation?

843789Feb 8 2010 — edited Sep 13 2010
If I have 2 classes - FirstClass and SecondClass. I want to pass FirstClass to SecondClass' constructor as follows:
public class SeconClass{


  FirstClass fc;
 
 public SecondClass(FirstClass fc){


    this.fc = fc;

}



}
I will now have access to all of FirstClass public methods. But my question is, am I creating an instance/object of FirstClass by doing this?

GF
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 11 2010
Added on Feb 8 2010
11 comments
288 views