In a class constructor, I am trying to use:
if(theObject != null)
this = theObject;
I search the database and if the record exists, I use theObject
generated by Hibernate Query.
Why can't I use this
?
It's because 'this' is not a variable. It refers to the current reference. If you were allowed to reassign 'this', it would no longer remain 'this', it would become 'that'. You cannot do this.
this
is not a variable, but a value. You cannot have this
as the lvalue in an expression.
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