This class is just a dummy class I use to reinforce the point that RMock is necessary for mocking classes in which constructors receive object parameters.
此类只是我使用的一个虚构类,用于强化一个要点:要模拟构造函数接收对象参数的类,有必要使用RMock。
If you want to declare a "real" (that is, useful) Dojo class, it's important to understand constructors.
如果希望声明一个“真正的”(即有用的)dojo类,那么一定要理解构造函数。
For instance, when I create a new class, I no longer spend any time writing setters and getters (accessors). I don't write most of the constructors.
例如,创建新类时,我不再花时间编写setter和getter(访问器),也不用编写大部分的构造器。
Reflection is the runtime discovery of information, such as methods, fields, and constructors, about a given class or interface.
反射是运行时发现的关于给定类或接口的信息,如方法、字段和构造函数。
But you cannot use a type parameter to access a constructor because, at compile time, you don't know what class is being constructed and therefore what constructors are available.
但是您不能使用类型参数访问构造函数,因为在编译的时候还不知道要构造什么类,因此也就不知道使用什么构造函数。
The primary constructor in a derived class must invoke one of the parent class constructors, either the primary constructor or an auxiliary constructor.
子类的主构造函数必须调用父类的一个构造函数,无论是主构造函数或者是辅助构造函数。
Thus, when a type parameter t is used as the superclass of a generic class, the annotation on t tells us exactly what super-constructors we can call.
因此,当类型参数t用作泛型类的超类时,T的注释确切地告知我们可以调用哪些超级构造函数。
Declaring all these constructors in each class could get tedious after a while, but we explored techniques in Chapter 4, Traits that can eliminate repetition.
为所有类声明这些构造函数可能是乏味的,但是我们在《第4章- Traits》中探索的技巧可以帮助我们减少这样的重复。
The Class reflection calls to access field information are similar to those used to access constructors, with a field name used in place of an array of parameter types.
获得字段信息的Class反射调用不同于那些用于接入构造函数的调用,在参数类型数组中使用了字段名。
Because Timer is a class rather than an interface and the threads are actually spun off in that class's constructors, an application server cannot modify this behavior.
因为Timer是类而不是接口,而且线程实际是在类的构造函数中产生的,所以应用服务器不能修改这种行为。
With the original version of the Motorcycle class, use the Source menu to generate a few constructors, like those shown in Listing 6.
在 Motorcycle类的原始版本中,使用Source菜单生成几个构造函数,如清单6 中所示。
Note how the abstract class defines a constructor that takes a Map of properties - I can always add more constructors later, and I will shortly.
注意抽象类如何定义一个构造函数,该函数接收属性的一个map—我总是可以稍后添加更多构造函数,稍后我就会这么做。
If you look closely at the description for the list class in Listing 2, you'll see that two different constructors are provided. One takes no arguments, and the other takes a sequence class.
如果仔细观察清单2中对list类的描述,您会看到其中提供了两个不同的构造函数:一个没有参数,另一个接受一个序列类作为参数。
Two constructors are defined on the class: one taking an int and one taking a pair of ints.
类中定义了两个构造函数:一个构造函数带有一个int参数,另一个带有两个int参数。
A class may define several constructors, each of which must take a different number or type of arguments.
一个类可以定义几个构造函数,每个构造函数必须接受不同数目或者不同类型的参数。
Content Assist can now propose the available constructors of a class when the completion happens in an allocation expression.
当在写一个分配表达式(allocation expression)时发生补全操作,内容助手现在可以提示一个类的可用构造方法。
There is a definition for the class EggTrayIcon, the constructors, then the methods send_message and cancel_message.
该文件中含有类eggtrayicon的定义、构造函数以及方法send_message和cancel_message。
So, your class has two constructors, one with a function pointer and the other without it.
所以你的类将有两个构造器,一个有函数指针,另一个没有。
One possible implementation is to use this method as a hook into your own private class initialization routines that are not already enabled by constructors.
一个可能的实现是,将此方法用作构造函数尚未启用的您自己的私有类初始化例程的挂钩。
A class's members include all the members declared in the class, along with all members (except constructors and destructors) declared in all classes in its inheritance hierarchy.
类的成员包括在类中声明的所有成员,以及在该类的继承层次结构中的所有类中声明的所有成员(构造函数和析构函数除外)。
A class can have multiple constructors. Each constructor must differ from the others in the number or types of its parameters.
一个类可以有多个构造函数,每个构造函数必须有与其他构造函数不同数目或类型的形参。
There is a third possibility: The element type might be of a class type that does not define any constructors.
还有第三种可能性:元素类型可能是没有定义任何构造函数的类类型。
Describes how to define a class with fields, methods, and constructors.
描述如何定义具有字段、方法和构造函数的类。
If a class has one or more private constructors and no public constructors, other classes (except nested classes) cannot create instances of this class.
如果类具有一个或多个私有构造函数而没有公共构造函数,则其他类(除嵌套类外)无法创建该类的实例。
A class or struct may have multiple constructors that take different arguments.
一类或结构可以有多个构造函数以不同参数。
A class or struct may have multiple constructors that take different arguments.
类或结构可能有多个接受不同参数的构造函数。
Because the state of the call stack in a class constructor is not well defined, stack walk overrides placed in constructors can produce unexpected and undesired results.
由于类构造函数中的调用堆栈状态的定义不完善,所以放置在构造函数中的堆栈步重写可能会产生意外结果。
A link demand performed on a static class constructor does not protect the constructor because static constructors are called by the system, outside the application's code execution path.
对静态类构造函数执行的链接要求不会保护该构造函数,因为静态构造函数是由系统调用的,它们并不包括在应用程序的代码执行路径中。
A typical use of static constructors is when the class is using a log file and the constructor is used to write entries to this file.
静态建构函式通常用在当类别使用记录档,而建构函式被用来将项目写入该档案。
A typical use of static constructors is when the class is using a log file and the constructor is used to write entries to this file.
静态建构函式通常用在当类别使用记录档,而建构函式被用来将项目写入该档案。
应用推荐