S
S
sys_user2020-02-07 11:49:20
Java
sys_user, 2020-02-07 11:49:20

What is the name of such a construct in java?

What is the name of such a construction when in a static block? Write code that initializes variables
5e3d24604fcff822615628.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2020-02-07
@sys_user

Static initialization block
It is placed between field definitions and class functions. Commands will be executed in one of two cases, whichever comes first:

  • When creating the first object of the class in the course of the program, before running the constructor.
  • The first time a static function is called, before execution.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question