An Object is never a primitive, by definition. Do you mean is it one of the primitive wrapper types, like Integer, Float, Long, etc? You could use "instanceof Numeric" (java.lang.Numeric is the superclass of all the numeric wrappers.) If you mean something else -- well, you'll have to clarify.
In other words, attempt to convert it to a Double (or a Float or Integer, whatever is appropriate) and let the system determine if it's valid or not. If it throws an exception, it's not valid. I suppose an alternative would be to test the String against a regular expression, but that could get ugly with the different formats that you'd have to support (integer, real, scientific notation, etc.) [ October 29, 2003: Message edited by: Wayne L Johnson ]