Class constructors should be lazy.
类的构造函数应该是延迟的。
YUI Profiler allows you to register functions, class constructors, and objects to be measured.
YUIProfiler可以注册要测量的函数、类构造函数和对象。
Constructor injection in Spring lets you inject your dependencies through class constructors.
Spring中的构造函数注入允许您通过类构造函数注入依赖关系。
By the same token, it makes little sense to "initialize" it in any of the class constructors.
由于同样的原因,这是毫无意义的“初始化”,它在任何的类构造函数。
Therefore, you should not rely on class constructors to initialize thread-relative static fields.
因此,您不应依赖于类构造函数来初始化线程相关的静态字段。
This constructor is called by derived-class constructors to initialize the base class and is not intended for use directly from your code.
此构造函数由派生类构造函数调用以初始化基类,不适合直接在代码中使用。
The primary constructor in a derived class must invoke one of the parent class constructors, either the primary constructor or an auxiliary constructor.
子类的主构造函数必须调用父类的一个构造函数,无论是主构造函数或者是辅助构造函数。
Also, client classes that instantiate our generic class must do so with classes that meet the declared constraint on what constructors exist.
同样,实例化泛型类的客户机类必须使用满足对构造函数存在所声明的约束的类来这样做。
The rest of the class is just some basic constructors.
类的剩余部分就是一些基本的构造器。
It also includes details of the constructors, fields, and methods defined by the class.
它还包括该类定义的构造函数、字段和方法的详细信息。
Reflection is the runtime discovery of information, such as methods, fields, and constructors, about a given class or interface.
反射是运行时发现的关于给定类或接口的信息,如方法、字段和构造函数。
The Class reflection calls to access method information are very similar to those used for constructors and fields.
获得方法信息的Class反射调用与用于构造函数和字段的调用非常类似。
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反射调用不同于那些用于接入构造函数的调用,在参数类型数组中使用了字段名。
The PdfTextVerificationPoint class has two constructors, as shown in Listing 3.
PdfTextVerificationPoint类拥有两个构造器,如代码清单3所示。
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》中探索的技巧可以帮助我们减少这样的重复。
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类,那么一定要理解构造函数。
Notice the order of invocation of the class and trait constructors.
注意类和trait构造函数的调用顺序。
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 中所示。
That's just the start for CtClass, though, which also defines methods for adding new fields, methods, and constructors to the class, and for altering the class name, superclass, and interfaces.
不过,这只是CtClass的部分内容,它还定义了在类中添加新字段、方法和构造函数、以及改变类、父类和接口的方法。
The Message class implements two constructors, as shown in Listing 7.
message类实现两个构造器,如清单7所示。
Open up your newly created class, and change its constructors to public type.
打开新生成的类,将它的构造函数修改为public类型。
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(访问器),也不用编写大部分的构造器。
Not all components require all the values in this class, so it provides multiple constructors that implement optional arguments.
并非所有组件都需要这个类中所有的值,因此它提供了实现可选参数的多个构造器。
Then, inside the generic class definition, the only constructors that could be called are those declared in the bound.
因而,在泛型类定义内部,唯一可调用的构造函数是那些在界限中声明的构造函数。
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.
但是您不能使用类型参数访问构造函数,因为在编译的时候还不知道要构造什么类,因此也就不知道使用什么构造函数。
For classes with few constructor arguments or if you are creating many objects of the same class, this is viable but soon becomes untidy for classes whose constructors have lots of arguments.
对于带有少数几个构造方法参数的类,或者如果您正创建同一个类的多个方法,这是可行的,但是对于构造方法具有大量参数的类来说,很快就会变得杂乱无章。
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的注释确切地告知我们可以调用哪些超级构造函数。
Whenever you create this kind of utility class, it's important to create good constructors, so they can be created and used in just one line.
无论什么时候你创建这种功能类,重要的是创建好的构造器,这样它们能在仅仅一行创建和使用。
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是类而不是接口,而且线程实际是在类的构造函数中产生的,所以应用服务器不能修改这种行为。
应用推荐