Create a private method as shown below.
创建一个私有方法,如下所示。
Listing 11 is an example of accessing a private method in a class.
清单11展示了对类的私有方法的访问。
Is a private method returning true if the current user is logged in.
是一个私有方法,如果当前用户已登录则返回true。
You use the private method setUIText() to set all the text on the LogonUI.
可以用私有方法setUIText()设置LogonUI上的所有文本。
As with properties, any attempt to call a private method from outside the containing class causes a fatal error.
与属性一样,尝试从包含类外部调用私有方法将导致致命错误。
The reality is that the main() method simply executes a private method, go(), on an instantiated AtomToRdf class.
实际情况是main()方法只是在一个实例化的AtomToRdf 类上执行了一个私有方法go()。
Note that the invoke() method is overridden to either take an Object instance, as in Listing 4, or a Class, in the case that the desired private method is also static.
请注意invoke()方法被覆盖成可以接受一个Object实例(如清单4 所示)或一个Class(这时期望的private 方法也是 static 的)。
A subtle but important difference between auth and list is that list is a closure, whereas auth is a private method. (Closures use an equals sign in the definition; methods use parentheses.)
auth和list之间微妙但重要的一点区别是list是一个闭包,而auth是一个私有方法(闭包在定义中使用等号;方法使用圆括号)。
The city list is retrieved from the NWS using a private method if the NWS is online and from a file if the NWS is not online, and the method caches state and city information to improve performance.
在NWS在线的情况下使用私有方法来从 NWS检索城市列表,在 NWS不在线的情况下从文件中检索城市列表,该方法把州和城市信息存在高速缓存中以提高性能。
The city list is retrieved from the NWS using a private method if the NWS is online and from a file if the NWS is not online, and the method caches state and city information to improve performance.
在NWS在线的情况下使用私有方法来从 NWS检索城市列表,在 NWS不在线的情况下从文件中检索城市列表,该方法把州和城市信息存在高速缓存中以提高性能。
应用推荐