在一个静态初始化块中,在加载类时执行。
In a static initializer block, which executes when the class is loaded.
清单2显示了典型的静态初始化器。
如果您这样做的话,静态初始化软件会非常混乱。
Static initializers in particular can get very confused if you do that.
更多信息请见基本原理附录中的静态初始化一节。
See the Static Initialization section in the Rationale appendix for more information.
在初始化阶段,类中包含的静态初始化器都被执行。
During the initializing phase, any static initializers contained within a class are executed.
File和Singleton以及框架支持的静态初始化。
Static initialization with File and Singleton and framework support.
如果使用静态初始化器,就不可能自己捕获异常了。
If you use static initializers, you cannot catch the exceptions yourself.
提供描述构造函数的gbeaninfo静态初始化器。
Provide a GBeanInfo static initializer that describes the constructor.
此方法只应当从正在添加类处理的类的静态初始化内部调用。
This method should only be called within the static initialization of classes that are adding class handling.
我们将在类的静态初始化器中把 EmbeddedDriver 用于驱动程序类。
We use the EmbeddedDriver for our driver class in the static initializer of the class.
静态初始化器和静态构造函数提供了最洁净的、最间接的方式来初始化类的静态成员。
Static initializers and static constructors provide the cleanest, clearest way to initialize static members of your class.
加载类之后,静态初始化器首先运行,紧接着运行的是main方法(也是静态的)。
The static initializer runs first, as the class is loaded, followed by the main method (which is also static).
带有静态初始化器的permissions类为声明和配置可用的应用程序权限提供单一位置。
A permissions class with a static initializer provides a single location for declaring and configuring available application permissions.
这条信息位于beaninfo类中,该类通常在bean的类通过静态初始化器装入时,由bean提供。
This information resides in a BeanInfo class, which is typically provided by your bean when the bean's class is loaded via a static initializer.
作者提出了一种任务控制块静态初始化的方法,和一种动态分配片内存储空间的方法,来解决单片机资源紧张的问题。
The author issues a method of statically initializing task control blocks, and a method of sharing on-chip memory dynamically, in order to save the insufficient resource on micro-controllers.
Permissions从不实例化,它提供构建Enum类型的静态初始化器,该Enum类型可以为应用程序配置权限。
Permissions is never instantiated — it features a static initializer that builds up the enum types that configure permissions for the application.
清单2中的静态初始化器显示了Customer类的注册过程,这个类包含两个属性:name和salary。
The static initializer in Listing 2 shows the registration process for a Customer class that contains two properties: name and salary.
现在,要将这些结果转换成一个静态初始化的数组,我们需要删除这个程序的前半部分,并将其替换成手工计算出来的结果,如下所示
Now, to convert this to a statically initialized array, you would remove the first part of the program and replace it with something like this, calculated by hand
如果您有一些静态数据想提供给jsp页面使用,并且那些数据不会频繁地改动,初始化参数可能会是一个比较好的选择。
If you have some static data that you want to make available to your JSP page and that data does not change frequently, initialization parameters may do the trick.
运行库在何时初始化静态字段?
这些属性然后在主体文件中被初始化,并且静态属性也会被初始化。
The attributes then gets initialized in the body file where the static attributes get initialized.
由于单例对象作为实例存在而不是类的静态成员,所以你能够惰性地初始化单例对象,即只需要在第一次用它的时候才去创建它。
With singletons implemented as single instances instead of static class members, you can initialize the singleton lazily, creating it only when it is first used.
数据结构的静态汇编时间初始化。
实际的应用程序会从数据库中获得模型的数据,但为了简便起见,OrderBean将由一个静态数组初始化。
A real application would retrieve the model's data from a database, but for simplicity, OrderBean is initialized from a static array.
处理这个问题的一种方法是提供一个公共静态initialize方法,初始化失败时该方法将抛出一个检查到的异常。
One way to handle this is to provide a public static initialize method that throws a checked exception when initialization fails.
由于会反复调用该类,因此应将初始化WebSphereTXAPI的代码移动到一个静态块中
Since this class will be invoked repeatedly, move the code that initializes the WebSphere TX API into a static block
在清单2中,代码首先包含了MDB2_Schema包所需的类文件,然后通过调用其静态方法factory以初始化mdb2抽象层。
In Listing 2, the code first includes the necessary class file for the MDB2_Schema package, and then initializes the MDB2 abstraction layer by calling its static factory method.
我们所做的第一件事就是使用SDO_DAS_XML:create静态方法,该方法用包含blog描述的模式文件初始化xmlDAS。
The first thing we do is use the SDO_DAS_XML: : create static method to initialize an XML DAS with the schema file containing the description of our blog.
支持添加静态属性和修改enums(自动初始化)
Support for adding static fields and changing enums (automatic intialization)
首先,它初始化这些系统类不需要线程支持来执行这些静态的初始化。
First, it initializes those system classes that don't require thread support by executing their static initializers.
应用推荐