while developing, my brain suddenly came up with a stupid idea and due to that, also a question about understanding.
I was writing a method to shut down my database connection and driver and I thought about after cleaning up my used objects and stuff, just doing this = null
and I was pretty sure, that this won't work. But I tried anyways and IntelliJ of course presented me a nicely formatted error message "Variable expected" when hovering over "this".
So I asked myself how "this" is working (huehue, I like the wordplays). I would be very glad if you could explain it to me. I am basically not a newbie in Java but I didn't thought about "this" (xD) 'til now and just used it.
Is it kind of an alias for the current object? Is it final? Is it just a keyword (I know it IS a keyword) with some special behaviour? I would really appreciate understanding one of the most-used words in my source code.