I understand what static is but I can't find information how are the static fields referenced through the objects.
Let's imagine that we have two classes:
class Foo { static int statValue = 10; } class Bar { public static void main(String[] args) { Foo foo1 = new Foo(); int valFromObject = foo1.statValue; int valFromClass = Foo.statValue; } } When we run this program we have one object on heap (foo1), and two classes in metaspace (simplified).
When we access static field through the class:
int valFromClass = Foo.statValue; it is easy, because I assume that we reference class object in metaspace. But how are the static members accessed through the objects? When we write:
int valFromObject = foo1.statValue; is the Foo instance actually involved or it is bypassed and
foo1.statValue; Foo.statValue are synonyms?

foo1(the type that was used to declare the variable, in this caseFoo) is used to access the static field. The actual instance does not play a role.foo1.statValuewill yield a compiler warning. You shouldn't even be writing code like that.