I\'m playing around with Java\'s reflection API and trying to handle some fields. Now I\'m stuck with identifying the type of my fields. Strings are easy, just do myFi
myFi
Another option is instanceof:
Object o =... if (o instanceof Number) { double d = ((Number)o).doubleValue(); //this cast is safe }