`foo = () -> 3` vs. `foo() = 3`

Could you explain a bit more about this?
I wonder, why it is the second g()=4 which is the only once definition?