how to convert object to string in java
<p>I have a function that returns map value (String) as a generic Object. How do I convert it back to string. I tried toString() but all i get is <code>end[Ljava.lang.String;@ff2413</code></p>

<pre><code>public Object getParameterValue(String key)
{
    Iterator iterator=params.entrySet().iterator();

    while(iterator.hasNext())
    {
        Map.Entry me=(Map.Entry)iterator.next();
        String[] arr=(String[])me.getValue();
        log.info(me.getKey().toString()+"="+arr[0]);
    }
    if(params.containsKey(key))
    {
        log.info(key+"="+params.get(key));
        return params.get(key);
    }


    return null;
}
</code></pre>

<p>Receiving end</p>

<pre><code>String temp=data.getParameterValue("request").toString();
log.info("end"+temp);
</code></pre>

<p><code>log.info(me.getKey().toString()+"="+arr[0]);</code> give me an output </p>

<pre>
email=x@as.com
request=login
projectid=as
</pre>

<p>Here is what i did, and it solved my problem</p>

<pre><code>String[] temp=(String[])data.getParameterValue("request");
    log.info(temp.length);
    for(int i=0;i&lt;temp.length;i++)
        log.info("end"+temp[i]);
</code></pre>
