Listing 3. Annotation for toString generation.
清单3 . toString生成的注释。
Listing 5. ToString annotations on JDK 1.4.
清单5。
Listing 7 shows some test classes for the ToString annotation.
清单7展示了ToString注释的一些测试类。
Adjust the toString method of Tweet.groovy as shown in Listing 15.
按清单15调整Tweet . groovy的toString方法。
The toString method is what the JList calls to display the results.
JList调用toString方法显示结果。
Doing so prevents the toString method from printing a lot of output.
这样做可以阻止toString方法输出过多内容。
The toString generator also gives you the ability to handle arrays.
您还能使用toString生成器处理数组。
The other method that is now available for all array types is toString .
所有数组类型都可用的另一个方法是toString 。
You can define annotations for toString generation in many different ways.
可以以多种方式为toString的生成定义注释。
Default equals, hashcode, and toString methods are automatically generated.
自动生成默认的equals、hashcode和toString方法。
A new feature in Eclipse Galileo is the ability to generate toString methods.
Eclipse Galileo中的一个新特性是能够生成toString方法。
The four toString() calls in Listing 10 create something like this, respectively
清单 10 中的四个 toString() 调用分别创建了以下内容
Custom templates allow you to adjust the output generated for the toString method.
自定义模板允许您调整toString方法生成的输出。
The first two lines demonstrate the difference between using toString and Formatter.
前两行展示了使用toString和Formatter的不同结果。
The solution, of course, is to add the def keyword to numstr in the toString method.
当然,解决方案也是在 toString方法中将 def关键字添加到 numstr。
Rectangle is also a concrete subclass of Shape that defines draw and overrides toString.
Rectangle也是Shape得一个具体子类,定义了draw方法,重写了toString。
Unfortunately, writing an arbitrary object to a stream invokes the object's toString method.
不幸的是,将对象写入流就要调用对象的toString方法。
The toString method will return the error message along with a reference to another exception.
toString方法将返回错误信息及另一个异常的引用。
However, the option List contents of arrays instead of using native toString changes that.
但是,选项List contents of arrays instead of using native toString改变了这种情况。
Now, when you run the main method, the Automobile object's toString output looks like Listing 8.
现在,运行main方法,Automobile对象的toString输出如清单8所示。
The ToString annotation I used as an example is interesting and (at least for me) somewhat useful.
我用作例子的 ToString 注释是有趣而且(至少对于我来说)比较有用的。
The error displayed is a NullPointerException occurring in the toString method on the Appointment class.
显示的错误是一个NullPointerException,它发生在appointment类上的toString方法中。
As before, we omit the curly braces "{...}" around the body of toString, since it has only one expression.
像之前一样,我们省略了toString方法主体两边的大括号“{…}”,因为我们只有一个表达式。
The name and ordinal methods report back the constructor arguments, and toString reports back the name.
name和ordinal方法返回构造函数参数,而toString返回名称。
In an earlier column, I gave an example of using annotations for automatic construction of toString methods.
在早期专栏中,我提供了一个使用注释自动构建toString方法的示例。
With that option selected, the toString method can be regenerated, and the new output looks like Listing 10.
选中该选项,重新生成toString方法,新的输出如清单10所示。
That way, when the toString method is called, it offers indention for easier manual reading of these documents.
这样,当toString方法被调用时,它可以实现缩进,以使这些文档更易于阅读。
By calling the toString method of the root-level node, the framework can easily marshal the entire XML document.
通过调用根级别节点的toString方法,这个框架可以轻松编组整个XML文档。
Listing 6 shows the final portion of the implementation code, which actually adds the toString method to a class.
清单6展示了实现代码的最后部分,它实际上向类添加了toString方法。
After a bean accesses its data source, it prints out the object's toString . This code is the same in both beans.
在bean访问过它的数据源后,打印出对象的toString 。

词典释义: