这个模型在声明一个类实现多个抽象的时候非常有用。
This model is very useful for declaring that a class exposes multiple abstractions.
如果不是这种情况,则声明一个类为可序列化类是错误的。
It is an error to declare a class Serializable if this is not the case.
到这里为止,我们学习了如何声明一个类,如何初始化它们,以及继承的一些基础。
So far, we've covered how to declare classes, how to instantiate them, and some of the basics of inheritance.
在代码中,可以通过声明一个类继承自另一个类来指定对象间的继承关系。
In code, you can specify inheritance relationships between objects by declaring that one class inherits from another.
使用引入(Introduction),Aspect可以向类中添加新的方法和变量、声明一个类实现一个接口或将检查异常转换为未检查异常(unchecked exception)。
Using introduction, aspects can add new methods and variables to a class, declare that a class implements an interface, or convert checked to unchecked exceptions.
清单1展示了一个示例注释声明,后面是将该注释用于某些方法的类的定义。
Listing 1 shows a sample annotation declaration followed by the definition of a class using that annotation on some methods.
定制绑定提供者是一个带有声明元数据文件的定制绑定类的包。
The custom binding provider is the packaging of custom binder classes with a declarative metadata file.
现在,尝试为类a使用一个复制结构和运算符赋值,在清单15中声明该类。
Now, try using a copy construction and operator assignment for class a, declared in Listing 15.
无需声明类,因为实际上,每件东西都是一个对象。
There is no need to declare classes, and actually, pretty much everything is an object anyway.
为便于使用,我们定义了一个eventconstants类来声明一些有用的常量,例如主题字符串。
For ease of use, we define a EventConstants class to declare some useful constants such as topic strings.
也就是说,我们不必首先声明一个混合了所有我们所需要的trait的类。
That is, we don't have to declare a class first that mixes in all the traits we want.
如果希望声明一个“真正的”(即有用的)dojo类,那么一定要理解构造函数。
If you want to declare a "real" (that is, useful) Dojo class, it's important to understand constructors.
AlgoNames(清单16)是一个只指定XML加密所需要的名称空间声明的助手类。
AlgoNames (Listing 16) is a helper class that only specifies namespace declarations required by XML Encryption.
在这个例子中,我期望groovyc创建至少两个.class文件——一个用于song类,另一个用于Song声明之后的脚本代码。
In this case, I expect groovyc would create at least two.class files — one for my Song class and another for the script code following Song's declaration.
这一代码清单创建了一个名为ClientSocket的新类,随后声明了一个名为“xml_socket”的xml套接字对象。
This code listing creates a new class called ClientSocket and then declares an XML socket object named "xml_socket."
可以为所创建的类创建一个终结器并将它声明为final。
You can create a finalizer for the class you're creating and declare it as final.
实际上,我们的Widget类也可以被声明为一个trait。
In fact, our Widget class above could have been declared to be a trait.
在一个dojo类中,可以声明一个preamble、一个constructor和一个postscript,但是在大多数情况下,您只需要声明一个构造函数。
In a Dojo class you can declare a preamble, a constructor, and a postscript, but in the majority of cases you will only need to declare a constructor.
第一步是声明一个从WebTestCase扩展而来的类,如清单3所示。
The first step is to declare a class that extends from WebTestCase, shown in Listing 3.
它将来建立一个临时的A类来保存声明表达式的值,而这个临时类是用来引用Foo的。
Will construct a temporary a object to hold the result of the statement expression, and that will be used to invoke Foo.
它使用一个规则参数来声明和描述一个用户可以键入一个合格的类名称的域。
It USES a rule parameter to declare and describe a field where the user can type a qualified class name.
清单1显示一个声明了两个属性的类。
如果它不是一个静态类,那么需要首先声明保存有对此嵌套类的父类的引用的那个字段的名称,之后才能看到这个预览框。
If it is not a static class, you first need to declare the name of the field that will hold the reference to the parent class of the nested class before you get to the preview box.
为此,需要声明一个专门的异常类,指出已经告知结果。
To do that, declare a a special exception class that indicates the result has been signalled already.
它可以在一个类或全局范围内声明。
不过作为一个免责声明,我一直在使用消费类硬件产品,而不是高端专业的东西。
As a disclaimer, though, I've been using consumer hardware, not high-end professional stuff.
您可以修改已有类,将它作为参数传递,并利用API,而不需要基础 API 声明一个抽象类或接口。
You can modify an existing class, pass it as a parameter, and take advantage of the API without requiring the base API to declare an abstract class or interface.
在隐式创建服务时,bean被公开为单一服务,方法是将bean类本身声明为服务的一个接口。
In the case of implicit service creation, the bean is exposed as a single service by declaring the bean class itself as an interface for the service.
这次在NewClass向导中,我们将在同一个名称空间中声明新类,但是把它称为MegaLottery。
This time in the new class wizard, we'll declare our new class in the same namespace, but call it MegaLottery.
这次在NewClass向导中,我们将在同一个名称空间中声明新类,但是把它称为MegaLottery。
This time in the new class wizard, we'll declare our new class in the same namespace, but call it MegaLottery.
应用推荐