Java – Determine if object is integer

integerjavaobject

How to determine if Object is Integer? Something like:

if (obj.isInteger()) {...}

Best Solution

if (obj instanceof Integer) {....}