I am creating a method for an object in java, but I would like to use the object I'm in as parameter. So for example:
public void method1(String name)
{
example = new object2(name, object1);
}
Where object1 should be the object I'm calling the method from. So I want to create a new object of another class, and this class will use this object as parameter.
I tried to find if there's already a question about this, but couldn't find it. I read other questions (~10) to see if they contained what I needed, but they didn't. If anyone does find a duplicate, would he / she be kind enough to also explain what search they used?