class InstanceOfExample { public static void main (String args[]) { Object obj; obj = "Distributed Applications"; if (obj instanceof Integer) { System.out.println ("obj is an instance of Integer"); } else if (obj instanceof String) { System.out.println ("obj is an instance of String"); } else if (obj instanceof Double) { System.out.println ("obj is an instance of Double"); } } }