How to access an object which is created in some method, from different method?
<p>I want to access an object which is created in some method of a class, from other method of same class.</p>

<pre><code>public class SomeClass implements SomeInterface{

public void someMethod(int a, int b){ //Implemented method
{
 SomeOtherClass soc = new SomeOtherClass();
//some setting process
}

public int someOtherMethod(){
SomeOtherClass newSOC = soc;//Here, can i access the soc object created in "someMethod"
}
}
</code></pre>

<p>Actually, i want to set some data in the object and retrieve the data from different method. Is that possible!!! </p>
