(String) or .toString()?
<p>Actually, this question has no big meaning, I guess.</p>

<p>The situation is: I have a method with an "Object o" parameter.</p>

<p>In this method, I exactly know there is a string in "o" which is not null. There is no need to check, or do something else. I have to treat it exactly like a <code>String</code> object.</p>

<p>Just curious - what is cheaper - cast it to <code>String</code>, or use <code>Object.toString()</code>?
Or is it same by time-/cpu-/mem- price?</p>

<p>Update:
The method accepts "Object" because it's the implementation of an interface. There is no way to change the parameter type.</p>

<p>And it can't be null at all.  I just wanted to say that I do not need to check it for null or emptyness.  In my case, there is always a nonempty string.</p>
