私有构造函数是一种特殊的实例构造函数。
构造函数调用仅作为实例构造函数中的第一条语句有效。
Constructor call is valid only as the first statement in an instance constructor.
接口不能包含常量、字段、运算符、实例构造函数、析构函数或类型。
An interface cannot contain constants, fields, operators, instance constructors, destructors, or types.
不应该使用实例构造函数、一些特殊的私有方法、任何其它习惯来初始化静态变量。
You should not use your instance constructors, some special private function, or any other idiom to initialize static variables.
如果编程语言没有对静态类的内置支持,则应将静态类声明为密封的和抽象的,并添加一个私有实例构造函数。
Do declare static classes as sealed and abstract, and add a private instance constructor, if your programming language does not have built-in support for static classes.
因为本实例没有任何特殊的构造函数、操作、属性或引用,所以不需要这些调用。
This instance doesn't have any special constructors, operations, attributes, or references, so these calls aren't required.
我还创建了一个接受所有三个属性的构造函数,这将便于创建新实例。
I've also created a constructor that takes all three properties, which will facilitate creating new instances.
此外,枚举类型支持拥有构造函数、实例方法和变量,等等。
In addition, enumerated types support having constructors, instance methods, and variables, among other things.
请注意,站点的构造函数接受设计器宿主实例。
Note that the site's constructor accepts a designer host instance.
在大约200,000个通用构造函数调用的实例上,两种算法大约90%的时候都可以预测到结果。
On approximately 200,000 instances of generic constructor invocations, both algorithms predicted the correct result approximately 90 percent of the time.
同时也创建了用于设置这个实例变量的构造函数。
It also creates a constructor that sets this instance variable.
构造函数只是创建特定类实例(或对象)的特殊方法。
A constructor is just a special method that creates an instance (or object) of a particular class.
构造函数没有参数,并且返回的类型实例中的所有属性都为空。
The constructor function has no parameters and returns an instance of the type with all of its attributes set to null values.
<ui:button>的实例被作为参数传递给构造函数,我使用 this.element保持对它的引用。
The instance of the <ui:button> is passed as a parameter to the constructor function and I keep a reference to it as this.element.
如果定义了一个关系,那么必须把受保护的类实例(Resource)传递到ResourcePermission构造函数中。
If a relationship is defined, then the class instance (Resource) being protected must be passed into the ResourcePermission constructor.
LaunchApp使用Assembly .LoadFrom静态方法创建Assembly对象的实例,而不是通过显式调用构造函数来创建。
LaunchApp creates an instance of an Assembly object using the Assembly.LoadFrom static method rather than by using an explicit constructor call.
J2SE客户端可以通过BankingService的两个构造函数创建服务实例。
A J2SE client can use BankingService to create a Service instance via its two constructors.
在内部,Scope依赖线程静态字段存储提供给Scope构造函数的实例的Stack。
Internally, Scope relies on a thread-static field to store the Stack of instances supplied to Scope's constructor.
该构造函数使用packagebuilder类的实例解析和编译源文件中包含的规则。
This constructor USES an instance of the PackageBuilder class to parse and compile the rules contained in the source file.
Greeter构造函数创建了Message的实例,随后会在greet方法调用中使用它。
The Greeter constructor creates an instance of Message, which it then USES in the greet method call.
接下来,初始化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.
清单2中提供了用于MainFrame构造函数、实例和显示画面所使用的代码。
The code for the MainFrame constructor function and for the instantiation and display of the frame is provided in Listing 2.
这里的creator属性被设置为值new,这意味着DWR应当调用类的默认构造函数来获得实例。
The creator attribute here is set to the value new, meaning that DWR should call the class's default constructor to obtain an instance.
@Name注释告知Seam使用默认的类构造函数创建新实例。
The @Name annotation tells Seam to use the default constructor of a class to create a new instance.
这个行为在DI世界中称作构造函数注入,因为实例是通过一个构造函数传递的。
This behavior is referred to in the DI world as constructor injection, because the instance is passed through one of the constructors.
正如您所料,这个构造函数将在创建类的一个实例时得到调用。
This will be called whenever an instance of this class is created, just as you would expect.
但是在我们对超类所知的一切只限于它是类型参数的实例化时,对于什么样的构造函数可用于给定的实例化,我们没有任何概念。
But when all we know about our superclass is that it's some instantiation of a type parameter, we have no idea what constructors will be available for a given instantiation.
现在我们不依赖于外部的全局对象,只是通过构造函数传递对象实例。
Now we don't depend on external global objects, just on the instances passed in the constructor.
这种实例化涉及到要调用的类的默认构造函数,随后还要注入依赖关系。
This instantiation involves the default constructor for the class being called, with the injection of dependencies happening afterwards.
处理该问题的另一种方法是:只要泛型类的运行时实例化没有包括所需构造函数,就抛出异常。
Another way of handling this problem would be to throw an exception whenever a run-time instantiation of the generic class does not include a needed constructor.
应用推荐