Specification (java standard specification)

Source: Internet
Author: User
Tags true true
Training Content:1,General naming:①. The first letter of a word is in upper case, and the other is in lower case. For example, how are you → howareyoutelephone number → telephonenumber ②. If the number of words is too long, you can abbreviation it. For the abbreviations, see the following rules: a. Take the homophone Abbreviation: for example, oderitem à odritmb, and take the first three abbreviations: for example, request à req ③, only the first letter is used. (Not commonly used) ④. If the variable has professional terms, you need to use professional terms. ⑤ Abbreviations of several words (such as XML and SQL): for defining constants, refer to the following format: static final string xml_document = "text/XML "; for method name, variable header text, and Class Name, use the following format: private document xmldocument; // Private document myxmldocument; public class xmldocument; 6. Variable names of different cases cannot be used, but other variables are not allowed. For example, thesqlinputstream and thesqliputstream are not allowed.2,JavaRelated names:①. Package naming method: rewrites the Company domain name, for example, JP. co. nttdata. roukin. IB. business. enduser ②. Class naming method: If a class is a collection, the class name must be in the plural form.
Example: public class types {public final static int bit =-7; public final static int tinyint =-6; public final static int smallint = 5; public final static int integer = 4; public final static int bigint =-5; public final static int float = 6; public final static int real = 7; public final static int double = 8; public final static int numeric = 2; public final static int decimal = 3; public final static int char = 1;} if it is a business class of this project, name it as follows:X xx X xxBean(Fixed) take the lead ID (3 English letters) Business ID (3 English words) ※business ID, take the first letter of the lead ID in uppercase. ①. Method naming: Use a verb. The first verb has lower-case letters, and the first letter of other words has upper-case letters. Prefix. Please refer to the following link for more information:
Note (obtained by token) Get
Login Set
Update Update
Division Delete
When too many then (*) Is
Computing Calculate
Generate Create
② Constant naming:Define constants in constant classes and use static and final to modify them. The constant names are all capitalized and connected with "_" in the middle. The constant name cannot be abbreviated. For example, public static final string minimum_balance = "www"; ③. If the set name is a set of objects, the set name must be in the plural form. ④ Resource file naming cannot be abbreviated.2,Additional provisionsFor more information, see Java Naming Conventions.
/***** ○ Retrieve the token. ** @ Param bizform ××× image force situation ** @ Param requestattr when there are too many bytes out of memory when there are too many threads * @ Param sessionattr when there are too many bytes in-out unless otherwise required * @ Param ibuser Statement (not required: XXXX) * @ return Boolean がし true, true True False false. */
 


For more information about field names, see comments.Comment at the end of the field.
Public integer brccode; // the shop floor is too large
 Annotations inside the MethodInternal technical support and technical support content segmentation conditions, etc) record your website. When there are too many other operators, it is necessary to upload them again when there are two rows above the original rule. The first line is too large. Please refer to the following documents for more information.
/*** ○ Getting complete records, and ×××を getting complete records. , * /// ○ Selection of Dynamic Site combination // XXX others selection of Dynamic Site combination
For more information about the control block, see the following sample:
For (I ...) {For (J ...) {While (...) {If (...) {Switch (...) {}// End switch} // end if} // end while} // end for j} // end for I
 


JSP commentsRefer to the following format for the authorization JSP header:

Please refer to the following two lines for the first line of record-writing. When the JSP keyword is used, please refer to the following two lines for better information:

 


<% -- Copyright c NTT Data Corporation 2006 All Rights Reserved.Hogehoge. jsp-- %> Too many connections...

Java program has been written into our library. the name is provided by the Japanese website.

<% --

[Screen name] <br>XxxxxxxScreen <br>[Host Performance Overview] <br>The number of samples used to calculate the number of samples. <Br>[Renewal and Renewal] <br>2006/4/10 ver1.00New planChen Mingjian <br>2006/5/10 ver1.00ShizhuN-0024ZookeeperChen Mingjian <br>@ Author NTT Data corporation @ Version 1.00 -- %> zookeeper compliance...
 3,Notes① "=" Cannot be used for string comparison, but equals can only be used, and fixed strings must be written before. For example, string name = bizform. Get ("name"); Boolean flag = "wanghai". Equals (name); ②. Internal classes and anonymous classes are not recommended. ③ When importing a package, you must specify a specific class. For example, import java. util. arraylist; import java. util. * is not recommended. ④ When using an array, be sure not to overwrite the array subscript. ⑤ If it is a set object, you need to clear the set before using it again. We do not recommend that you use the same set repeatedly. 6. If there is an if statement, even if there is only one line of code in the IF statement, {} must be added to the IF statement {}. 7. In swith statements, break must be added after each case and default must be added. Retry, in try... Return, break, and continue cannot be used in catch.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.