As i am new in java. I have searched about static mean in java and i got solution on stack overflow here but when i compiled it it is showing error. Can anybody suggest Where i am mistaking ?
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
}

 
     
     
     
    