Public float return value doesn't change

Hi all,
I have a problem with a float function, The value returned is always whatever it was set before.
Here is my code (main.cs):

private float a = 0;    
void Start() {
    a = 1;
}

public float getFloatA () {
    return a;
}

and my other code (to get value):

public main mainMethods;

void Update() {
    print(mainMethods.getFloatA) // returns 1
}

Fixed by adding the static keyword infront of all variables