tailieunhanh - HandBooks Professional Java-C-Scrip-SQL part 109

Tham khảo tài liệu 'handbooks professional java-c-scrip-sql part 109', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | You use the keywords to modify or qualify the type of a method s parameter or return value. For example the keywords out and in modify the parameters in the following declaration - void getData out Data data forIndex in int index The signature of this method says that index is only passed in and changes to it don t need to be returned but the method will modify the value of data. You can t use these keywords in class or category declarations. However if your class or category adopts a protocol that uses a remote messaging keyword you can repeat the keyword in the method signature of the implementation. The remote messaging keywords can be grouped into three categories those for pointer parameters those for return values and those for object qualifiers. Pointer Parameter Qualifiers This section discusses qualifiers that generally apply to pointer arguments. They tell the compiler how to handle copying values between address spaces so that the pointers can be dereferenced in both spaces and see the same value. The pointer parameter qualifiers are as follows in You will reading directly from the parameter or will dereference the parameter to read a value but not to write one. This qualifier can be used for non-pointers. out You will dereference the parameter to write a value but not to read one. This qualifier applies only to pointers. inout You will dereference the parameter both to read and write a value. This qualifier applies only to pointers. If you do not specify a qualifier the compiler will assume a parameter is inout. Certain types have special behavior with pointer qualifiers. For example when you declare a C-style string with type char the runtime system treats this as a value type with value equal to the character string pointed to and not a pointer and ships the entire string across between method calls. If you want to pass a string by reference you need to add another asterisk to its declaration in the parameter list for the method receiving the .

TÀI LIỆU LIÊN QUAN
10    158    1
6    184    1
7    162    1
5    157    1
6    160    1
6    152    1
6    150    1
6    206    1
7    154    1