另一方面,可以照下面的方法重写单参数构造器来修复错误。
On the other hand, the bug could be fixed by rewriting the single-argument constructor as follows.
如果您不希望自己的方法重写新的基类方法,则需要注意以下事项。
If you do not want your method to override the new base class method, the following considerations apply.
以一致的方式命名重写层次结构中的参数可以提高方法重写的可用性。
Consistent naming of parameters in an override hierarchy increases the usability of the method overrides.
当抽象类从基类继承虚方法时,抽象类可以使用抽象方法重写该虚方法。
When an abstract class inherits a virtual method from a base class, the abstract class can override the virtual method with an abstract method.
派生类中的方法重写基类方法,而且这两种方法的可见性修饰符是不同的。
A method in a derived class overrides a base-class method, and the visibility modifiers of the two methods are different.
该参数可以被过程或者是方法引用。但该参数的值不可以被过程或者是方法重写。
IN - the parameter can be referenced by the procedure or function. The value of the parameter can not be overwritten by the procedure or function.
该参数既可以被过程或者是方法引用。该参数的值也可以被过程或者是方法重写。
IN OUT - the parameter can be referenced by the procedure or function and the value of the parameter can be overwritten by the procedure or function.
事实上,重写是发现和纠正一些错误的最好方法,如语法和拼写错误。
In fact, rewriting is the best way to find out and correct some mistakes, like grammar and spelling mistakes.
无需创建接口和去掉整个模拟对象的存根—您可以有选择地重写方法并返回一个简单的模拟响应。
No need to create an interface and stub out an entire mock object - you can strategically override that one method and return a simple mocked-out response.
它实现了对提供的类编写者实例的传递处理,使您可以只重写需要特殊处理的方法。
It implements the pass-through handling for a supplied class writer instance, letting you override only the methods where you need special handling.
当子类所重写的方法被调用时,你可以在子类中对父类的内部状态进行操作。
In a subclass you can make assumptions about the internal state of the superclass when the method you override is getting called.
然后就可以放弃事件或者调用重写了基类的方法。
Then you can either abandon the event or must invoke the method overridden in the based class.
缺少这个注释可能表示开发人员没有意识到该方法被重写。
A missing annotation may indicate that the developer didn't realize the method was being overridden.
如果可以重写类的话,则可以重写它的方法的行为,因此您最安全的选择就是不允许将类子类化。
If the class can be overridden, its methods' behaviors can be overridden as well, so your safest bet is to disallow subclassing.
采用这种方法时,使用循环日志模式,可以以循环方式重写日志。
With this method, circular logging is used and logs can be overwritten in a round robin manner.
尽管对于重写方法,可能会多一点开销,但让编写测试的人专注于正在发生的事情是很重要的。
Although there maybe a little more overhead with regards to overriding methods, it is important to keep the test writer concentrated on what is happening.
EmptyVisitor只是提供了所有不同种类的visitor的空的实现,允许您只对感兴趣的visitor方法建子类和重写。
EmptyVisitor just provides an empty implementation of all the various types of visitors, allowing you to subclass and override only the visitor methods of interest.
在清单6中,您重写了Header方法,其被调用以便生成每一个页面的标题内容。
In Listing 6, you override the header method, which is called to generate the content for each page's header.
为了支持等待的线程,在清单2中已经重写了remove方法。
In Listing 2, the remove method has been overridden to support waiting threads.
你只需要继承BaseIntrospectionRule,重写你关心的方法,并添加相匹配的基于XML的元数据文件即可。
Simply inherit from BaseIntrospectionRule, override the methods you care about, and add a matching XML-base meta-data file.
搜索查询,同样,不难想象出,可以将它重写为一个方法调用。
Search query I made earlier, it's not hard to imagine rewriting it as a method call, either.
SQL查询的优化利用了一些复杂的功能,例如:查询重写、多连接(join)方法、详细的统计、并行性等。
The optimization of SQL queries utilize sophisticated features, such as: query rewrite, multiple join methods, detailed statistics, parallelism etc.
Swing适配器允许您子类化适配器,并且可以仅重写处理事件所需的方法。
The Swing adaptors allow you to subclass the adaptor and just override the methods you need to handle for the event.
现在您已经创建了一个原始标题的合理副本,您也需要重写Footer方法,以便于您生成页脚。
Now that you've created a reasonable facsimile of the original header, you also need to override the footer method so you can generate the footer.
它使用了HTTP的方法和页眉(header),但是重写了HTTP中管理连接和数据转移格式的部分。
It USES HTTP methods and headers, but it overrides the parts of the protocol that manage connections and data transfer formats.
为了举例说明,可以将%INCLUDE “lsxsd . lss ”行添加到Web服务的(options)部分,然后重写GetUserRoles方法,如下所示。
As an example, you could add the line % INCLUDE "lsxsd.lss" to the (Options) section of the Web service and rewrite the GetUserRoles method like this.
将调用重写后的execute方法来处理请求,它继承自超类org . apache . struts . action . action。
The overridden method execute , which is inherited from the super-class org.apache.struts.action.Action, is called for processing the request.
要定义任何可能的SAX事件处理程序,程序员必须扩展XML::SAX::Base并重写任何需要的方法。
To define any conceivable SAX event handler, a programmer extends XML::SAX::Base and overrides whatever methods are of interest.
如果需要重写,通过调用RewritePath方法来重写路径。
Rewrites the path, if needed, by calling the RewritePath method.
然后重写DefaultMetalTheme的getter方法,以便使用在外部资源文件中定义的颜色和字体。
Then they overwrite the getter methods of DefaultMetalTheme so that the font and colors defined in the external resource file are used.
应用推荐