From which memory area is my string called?
<pre><code>public class Do {

    static String s="Instance";

    public static void method(String s){
        s="Add";
    }

    public static void main(String[] args) {
        Do d=new Do();
        s="new Instance";
        String s="Local";
        method(s);
        System.out.println(s);
        System.out.println(d.s);
    }
}
</code></pre>

<p>output is: </p>

<pre><code>Local

new Instance
</code></pre>

<p>Here I am making a static global variable as "Instance" and after that I am again initializing it with "New Instance" in the main method.<br>
My question is in which memory area "Instance", "New Instance" and "Local" will go and how?</p>