How do you get and check an object's type in Java, as you can using Type t = obj.GetType();
in C#?
Try getClass()
. It returns the runtime class of the object.
Class clazz = obj.getClass();
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