I'm dealing with an API that returns Object
when I ask for a property.
Object x = r.getProperty("id");
But I know for a fact that this property in particular is a Long
. So these are the two options I'm weighing:
Long x = Long.parseLong(r.getProperty("id").toString());
Long x = (Long)r.getProperty("id");
Which one is preferred performance-wise?