The instanceof keyword returns true if what's on the left is a class, subclass or interface of what's on the right. Like this:
someObject instanceof someClass;
This lets you quickly check if an object is related to another class or interface! I honestly don't use it very often, but it can be very helpful for certain situations.
I hope you enjoyed this instanceof java tutorial! -
Free tips and programs:
Try my Java course for free:
Recommended Channels to Subscribe to
Career Karma:
TheNewBoston:
~
(2nd channel)
Alex Lee
0 Comments