how to convert a string to an type object java code example Example: how to convert a string to object in java String string = "Hello, World!"; Object obj = string;