"Hello, Amigo! Nice to see you again. Well, have you coped with the instanceof operator and type casting? As always, I'm delighted at your success."

"Yes, it wasn't so difficult. I can't wait to find out what's next!"

"What's next is even more interesting. I think it'll be interesting for you to study a couple of relevant lessons, especially since I once wrote them from memory…"

"When? Sorry, Professor. I didn't hear."

"Uh, right now. Sit down and get comfortable. Enjoy your reading!"

How the instanceof operator works

This isn't our first introduction to instanceof, but now you know much more about inheritance and other principles of OOP. It's time to understand how conversion operators work. Consider some practical examples and analyze potential errors.

Widening and narrowing of reference types

In a previous lesson, we explored converting primitive types. But now let's talk about the same operators applied not to primitive types, but to objects and reference variables.