Lukasz Kalnik
12/16/2024, 2:33 PMhfhbd
12/16/2024, 2:44 PMLukasz Kalnik
12/16/2024, 2:47 PMCaleb B
12/16/2024, 3:35 PMclass Foo {
public static final Foo INSTANCE = new Foo();
}
So they get instantiated when the static initializer runs, which is on the first time the class is accessedLukasz Kalnik
12/16/2024, 3:41 PMKlitos Kyriacou
12/16/2024, 3:54 PMSo they get instantiated when the static initializer runs, which is on the first time the file is accessedNo, not the first time the file is accessed but the first time the object is accessed.
Caleb B
12/16/2024, 3:55 PMKlitos Kyriacou
12/16/2024, 3:58 PM