Listing 2 shows a typical static initializer.
清单2显示了典型的静态初始化器。
In a static initializer block, which executes when the class is loaded.
在一个静态初始化块中,在加载类时执行。
We use the EmbeddedDriver for our driver class in the static initializer of the class.
我们将在类的静态初始化器中把 EmbeddedDriver 用于驱动程序类。
The static initializer runs first, as the class is loaded, followed by the main method (which is also static).
加载类之后,静态初始化器首先运行,紧接着运行的是main方法(也是静态的)。
The static initializer in Listing 2 shows the registration process for a Customer class that contains two properties: name and salary.
清单2中的静态初始化器显示了Customer类的注册过程,这个类包含两个属性:name和salary。
A permissions class with a static initializer provides a single location for declaring and configuring available application permissions.
带有静态初始化器的permissions类为声明和配置可用的应用程序权限提供单一位置。
A permissions class with a static initializer provides a single location for declaring and configuring available application permissions.
带有静态初始化器的permissions类为声明和配置可用的应用程序权限提供单一位置。
应用推荐