<identifier> expected Error in java Compilation : <p>As i am new in java. I have searched about static mean in java and i got solution on stack overflow <strong><a href="https://stackoverflow.com/questions/413898/what-does-the-static-keyword-do-in-a-class">here</a></strong> but when i compiled it it is showing error. Can anybody suggest Where i am mistaking ?</p>

<pre><code>public class Hello
{
    // value / method
    public static String staticValue;
    public String nonStaticValue;
}

class A
{
    Hello hello = new Hello();
    hello.staticValue = "abc";
    hello.nonStaticValue = "xyz";
}

class B
{
    Hello hello2 = new Hello(); // here staticValue = "abc"
    hello2.staticValue; // will have value of "abc"
    hello2.nonStaticValue; // will have value of null
}
</code></pre>

<p><a href="https://i.stack.imgur.com/cBHGd.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cBHGd.jpg" alt="enter image description here"></a></p>
