如果你不需要改变它,使用常量引用。
用常量引用给一个函数传递参数,是一种好的习惯。
Your normal habit when passing an argument to a function should be to pass by const reference.
当给函数传递参数时,你要养成的良好习惯是传递常量引用。
Your normal habit when passing an argument to a function should be to pass by const reference.
当errno设置为0时,将不会遇到任何问题,除非您无法用标准符号常量引用此设置。
When errno is set to 0, you've encountered no problems, except you can't refer to this with a standard symbolic constant.
这可以确保在代码中重复使用相同的常量字符串时,可以利用相同的字符串引用。
This ensures that repeated use of the same constant strings in your code will utilize the same string reference.
如果源代码文件中有名称空间声明,那么对类、函数和常量的所有引用都使用名称空间语义。
If a source file has a namespace declaration, then all references to classes, functions, and constants use the namespace semantics.
其它指令直接引用常量池中的值。
关键之处在于常量池包含对该类所用的其它类和方法的所有引用,还包含了该类及其方法的实际定义。
The key point is just that the constant pool contains all the references to other classes and methods used by this class, along with the actual definitions for this class and its methods.
通常,内存段名称并不是动态分配的;而是众所周知的,比如使用头文件中的常量,其他代码可以方便地引用它。
Typically, a segment name is not dynamically assigned; instead, it is well known, such as a constant in a header file, and easily referenced from other code.
在典型的树中,常量时间访问仅可在根(其他代码引用的节点)处可用。
In a typical tree, constant-time access is only available at the root (the node referenced by other code).
随后,您可以更改代码,使其仅引用常量,而不是实际的jsp页面文件,如清单8所示。
Then, you can change your code to only refer to the constants, rather than the actual JSP page files, as shown in Listing 8.
常量池后面还有几项,它们引用了类本身、其超类以及接口的常量池项。
Following the constant pool are several items that reference constant pool entries for the class itself, its super class, and interfaces.
通过改用常量来引用各J sp页面,应用程序的灵活性更上一层楼。
By moving to constants referencing your individual JSP pages, you've added yet another layer of flexibility to your application.
这里不需要调用一个字符一个字符地进行比较的equals函数,相反,您可以通过引用将解析器报告的名称与字符串常量进行比较。
Instead of making calls to equals which compares strings character by character, you can compare names reported by the parser against string constants by reference.
能够进一步提高servlet/JSP应用程序的可管理性的一种方式就是使用常量来引用所有 JSP页面目标。
One way you can further improve the manageability of your servlet/JSP application is to use constants for referencing all your JSP page destinations.
常量池引用被与指向内部数据结构的指针取代,成功的或者某种工作方式会被一种简单的形式替代。
Constant pool references are replaced with Pointers to internal data structures, operations that always succeed or always work a certain way are replaced with simpler forms.
您可以打开控制器servlet,只要将那一个引用account - information . jsp的常量改为引用account - summary . jsp即可,如清单9所示。
Instead, you simply open up your controller servlet and change the single constant referring to account-information.jsp to account-summary.jsp, as shown in Listing 9.
以前讲过,常量池中对类型、字段和方法的引用在开始时都是符号。
As mentioned earlier, references to types, fields, and methods in the constant pool are initially symbolic.
类定义现在包含了常量定义,并且通过类来引用它们。
Classes definitions can now include constant values, and are referenced using the class.
做所有类的常量池中的条目表引用一个类,类文件在使用吗?
Do all class entries in the constant pool table refer to a class that is used somewhere in the class file?
做所有类的常量池中的条目表引用一个类,类文件在使用吗?
Do all class entries in the constant pool table refer to a class that is used somewhere in the class file?
应用推荐