它们只通过构造函数初始化。
调用构造函数初始化对象的默认值。
Calls the constructor which initializes the object with default values.
假定分配成功,则通过运行默认构造函数初始化该对象。
Assuming that the allocation succeeds, then the object is initialized by running the default constructor.
第一个类使用构造函数初始化属性,第二个类使用静态工厂方法。
The first class USES a constructor to initialize the properties, and the second class USES a static factory method.
有了适当的方式加载一个可收集在构造函数初始化没有结束与重复的项目?
Is there a proper way to load an observable collection with initialization in the constructor without ending up with duplicate items?
构造函数要处理来自构造函数初始化式的异常,唯一的方法是将构造函数编写为函数测试块。
The only way for a constructor to handle an exception from a constructor initializer is to write the constructor as a function try block.
有什么方法可以利用隐式的拷贝构造函数初始化列表吗?有没有其他方式手动编写初始化列表吗?
Is there any way to make the implicit copy constructor use initialization lists? Is there any other way around manually writing the initialization list?
而对于含有内置类型或复合类型成员的类,则通常应该定义他们自己的默认构造函数初始化这些成员。
Classes with members of built-in or compound type should usually define their own default constructors to initialize those members.
为了避免这个问题,应当在构造函数中初始化复杂属性;然而,对于字符串、布尔值等简单属性则不需要这样做。
To avoid this problem, complex attributes should be initialized in the constructor; however, this is not necessary for simple attributes such as strings, booleans, and so on.
初始化这些字段不需要逻辑上的构造函数,这和很多面向对象语言不同。
No constructor logic is required to initialize these fields, in contrast to most other object-oriented languages.
这个检测器寻找在构造函数中初始化之前被读取的字段。
This detector finds fields that are read in constructors before they're initialized.
当作为构造函数参数时,这些可变或者不可变的变量会在一个对象被实例化的时候被初始化。
When used as constructor parameters, the mutable or immutable variables specified will be initialized when an object is instantiated.
其构造函数含有两个参数:初始化属性和预配置的记录器(logger)实例。
Its constructor takes two arguments: initialization properties and a pre-configured logger instance. Properties object contains the following.
例如,您可以在subtask类的构造函数中初始化这类资源。
For example, you could initialize such resources in the constructor of the SubTask class.
在一个初始化块中,仅在构造函数之前执行。
In an initializer block, which executes just before the constructor.
然而,现在我们在测试过程中只能够传递一个布尔值false给构造函数,以避免调用init方法和所有不必要的初始化逻辑。
However, now we can just pass a Boolean false to the constructor during our tests to avoid calling the init method and all the unneeded initialization logic.
这样也许应该说这整个trait实际上应该是一个类,这样你才能定义一个构造函数来初始化这个字段。
It might be that the whole trait should actually be a class instead, so you can define a constructor for it that initializes the field.
线程1通过运行Singleton对象的构造函数并将引用返回给它,来完成对该对象的初始化。
Thread 1 completes the initialization of the Singleton object by running its constructor and returns a reference to it.
接下来,初始化services_oembed类的一个实例,类构造函数被传递两个参数:YouTubeURL和一组选项。
Next, an instance of the Services_oEmbed class is initialized, with the class constructor passed two arguments: the YouTube URL and an array of options.
我还添加了一个构造函数,与调用大量setter方法相比,这个构造函数可以更加轻松地创建完全初始化的对象。
I also added a constructor that'll make creating fully initialized objects a lot easier as compared to calling a lot of setter methods.
创建了Zend _ Rest_Client对象的一个实例,在初始化操作中确定WikipediaAPI服务端点作为构造函数参数。
An instance of a Zend_Rest_Client object is created and initialized with the Wikipedia API service endpoint as constructor argument.
如果你没有为拷贝构造函数写正确的代码,就有可能造成list中对象的某些数据成员没有初始化。
If you do not write a correct code for the copy constructor, object within a list will have some data members uninitialized.
这个构造函数(在清单17中定义)允许初始化在超类小部件ajaxcommon . widgets . picker . PickerInputBox内所声明的小部件的属性。
The constructor allows the initialization the widget's properties declared in the superclass widget ajaxcommon.widgets.picker.PickerInputBox that is defined in Listing 17.
在构造函数(请参考 清单5)中,使用传入的 $orientation(页面方向)、$unit(计量单位)和 $format(页面大小)初始化父类。
In the constructor (see Listing 5), initialize the parent class using the $orientation (page orientation), $unit (measurement unit), and $format (page size) that were passed in.
初始化您的工厂(在构造函数中)。
类的这种重构也会改进代码,因为我们将初始化逻辑从对象的构造函数分离出来了。
This refactoring of the class also improves the code so that we have separated the initialization code from the object construction code.
类的这种重构也会改进代码,因为我们将初始化逻辑从对象的构造函数分离出来了。
This refactoring of the class also improves the code so that we have separated the initialization code from the object construction code.
应用推荐