I\'m trying to debug a program I inherited. This program contains Strings, array lists and collections, lots of casting between types, and I need to do some String manipulations
instance.getClass() is the way to go if you just want to print the type. You can also use instanceof if you want to branch the behaviour based on type e.g.