I have the problem that a given object could be one of several different objects (like files in a directory, that could be sound, image, text, ...) Is there the possibility to find out the type of the object beside from the 'instanceof' operator? Couse that would result in an endless if - then row ...
+3
A:
foo.getClass()
gets the java.lang.Class
object describing the class of the object.
Joachim Sauer
2009-07-21 14:17:03
that does the trick. ich geh auch gleich von der leitung runter.
machine
2009-07-21 14:26:11