I have a class called SomeClass
which has a method called methodToCall(SomeClass o)
If I instantiate SomeClass like this:
SomeClass itsObject = new SomeClass();
Can I then do this:
itsObject.methodToCall(itsObject);
Absolutely. How that will behave will depend on the implementation, of course.
Just as an example, equals
is defined to be reflexive, such that:
x.equals(x)
should always return true
(assuming x
is non-null).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With