java coding guidelines

Want to know java coding guidelines? we have a huge selection of java coding guidelines information on alibabacloud.com

The Java Coding Guidelines の#01 limit the life cycle of sensitive data in memory

directly allocated NIO buffer to read sensitive data from a file. After the data has been used. It can be cleared immediately, and sensitive data is not slow to exist in multiple locations, only in system memory.void ReadData () {Bytebuffer BB = bytebuffer.allocatedirect (16*1024); try (filechannel rdr = (new FileInputStream ("file")) . Getchannel ()) {while (Rdr.read (BB) > 0) {//does something with the Bufferbb.clear ();}} catch (Throwable e) {//Handle err or}}It is important to note that the

"Java Coding Guidelines" の#12 do not use insecure or weak encryption algorithms

= keygenerator.getinstance ("AES"); Kgen.init (+);//192 and-bits may unavailablesecretkey skey = Kgen.generatekey (); byte[] raw = skey.getencoded (); Secretkeyspec Skeyspec = new Secretkeyspec (Raw, "AES") Cipher.init (Cipher.encrypt_mode, skeyspec);//Encode bytes as UTF8; strtobeencrypted contains the//input string that was to be encryptedbyte[] encoded = strtobeencrpyted.getbytes ("UTF-8");// Perform encryptionbyte[] encrypted = cipher.dofinal (encoded);[Availability]The use of mathematical

Different browser-compatible CSS coding guidelines

It is necessary to master some Cross-browser compliant CSS coding guidelines. First: Understand the CSS box model (learning div+css layout is also very important, learn the CSS box model to learn DIV+CSS is not difficult) A thorough understanding of the CSS box model is the first thing, the CSS box model is not difficult, and basically supports all browsers, except for some specific conditions of IE brows

Resolving Cross-browser compliant CSS coding guidelines

Browsers are getting more and more, which means that the more difficult it is to do the Web front-end development. Now the core of the browser is the same, for the compatibility of CSS will also have a certain difference! Used to talk about using CSS hack is not an easy thing, with too much CSS hack to be compatible with a lot of bloated code, so it is necessary to master some Cross-browser compatible CSS coding g

Coding guidelines for cocoa

Refer: [1] Apple official [2] Three programming naming rules (Hungary, small hump, and big hump) The following is my personal reading notes for coding guidelines for cocoa. It mainly lists several items that are easy to violate. For details, see reference 1. 1. clarity and consistency 1) Apple generally uses the small camper name method, that is, the first letter of the first word is lowercase, and the fir

Writing high-quality code: 151 suggestions for improving Java programs (Chapter 1: common methods and guidelines for JAVA Development ___ recommendation 1 ~ 5), java151

Writing high-quality code: 151 suggestions for improving Java programs (Chapter 1: common methods and guidelines for JAVA Development ___ recommendation 1 ~ 5), java151 The reasonable man adapts himself to the world; The unreasonable one persists in trying to adapt the world himself. People who understand the truth adapt themselves to the world; people who do not

Java performance (1)-Java Programming Guidelines

Address: http://blog.csdn.net/jinhuiyu/archive/2008/12/10/3487584.aspx This part includes Java coding and performance issues. This guidelines is not dedicated to application servers, but it is a common rule in many cases, for a complete analysis of Java coding best practices

Reprint-------Write high-quality code: 151 recommendations for improving Java programs (1th: Common methods and guidelines in Java Development ___ recommended)

of 151 suggestions, including the first chapter of the Java grammar itself proposed 51 recommendations; the 4th to 9th chapter focuses on the use of the JDK API to put forward 80 recommendations; Section 10~ Chapter 12 provides 20 suggestions for program performance, open source tools and frameworks, coding styles, and programming ideas. According to the directory structure of the book, I read this book gr

Reprint----Write high-quality code: 151 recommendations for improving Java programs (1th: Common methods and guidelines in Java Development ___ recommended)

") method Ah! Fully conform to the specification, but this makes the compiler and caller depressed, the program conforms to the rules but can not run, so the question, who's responsibility? Is the designer of the Client5 class, he violated the kiss principle (Keep It smile,stupid, that is, lazy principle), according to this design method should be a call, but now follow the specification but compile does not pass, which for designers and developers should be banned.For Client5.methoda ("China",

Reprint--Write high-quality code: 151 Suggestions for improving Java programs (1th: Common methods and guidelines in Java Development ___ recommended 16~20)

that does not explain why our example is not running in IDE tools such as Eclipse. That's because automatic compilation in the IDE doesn't reproduce the problem, and if you modify the constant class, the IDE tool automatically compiles all the reference classes, "smart" masks the problem, but the potential risk is still there, and I remember that Eclipse should have a portal set up for automatic compilation. You are interested to try it yourself. Note: The use of class file substitution is proh

Java coding specification, java Coding

Java coding specification, java Coding 1. Java Naming ConventionsIn addition to the following special cases, full English descriptors should always be used for naming. In addition, lowercase letters are generally used, but the class name, interface name, and the first letter

Java Development specification summary_code coding specification, java Coding

Java Development specification summary_code coding specification, java Coding It is a good habit to gradually develop codes. 1. Basic Principles Mandatory principle:1. The StringBuilder must be used for string addition;2. try... Catch usage Try {} catch {Exception e. printStackTrace ();} finally {} // It Can Be Used in

Java Learning notes-0918 weeks in Silicon Valley *: More time teacher Kang is giving us directions and guidelines

basic knowledge, more time teacher Kang is to give me a direction and guidance, in the course of these knowledge to clean up, I will again consult the corresponding API and interpretation, and then the difficult point can finally reach the knowledge and finally know its why. API is the soul of Java, transparent interpretation of the API, to the project combat is also fearless handy, so-called everything is not the case.4. Career planning: for career

Java Learning notes-0918 weeks in Silicon Valley *: More time teacher Kang is giving us directions and guidelines

basic knowledge, more time teacher Kang is to give me a direction and guidance, in the course of these knowledge to clean up, I will again consult the corresponding API and interpretation, and then the difficult point can finally reach the knowledge and finally know its why. API is the soul of Java, transparent interpretation of the API, to the project combat is also fearless handy, so-called everything is not the case.4. Career planning: for career

Guidelines for using MongoDB in Java

()) { System.out.println (Cursor.next ())} } finally { cursor.close ();}All the documents in the MyCol collection are exported.You can also specify criteria for the lookup, such as:Basicdbobject query = new Basicdbobject ("I", ();D bcursor cursor = coll.find (query); try {while (Cursor.hasnext ()) { C5/>system.out.println (Cursor.next ());} } finally { cursor.close ();}For cases where the $ operator is included in the find condition, such as one of the following MONGO shell comm

Six basic guidelines for JAVA design patterns to follow

Six basic guidelines for JAVA design patterns to followa single principle of responsibility: (Responsibility pinciple) A class is responsible for only one responsibility. When more than one responsibility is required, new classes need to be added to take responsibility for new responsibilities, rather than personality codes in the class.If a class takes on too many responsibilities, it is highly functional

Java coding specifications that you should read before coding

Java coding specifications 1.1 why coding standards are especially important for programmers, there are several reasons: 80% of the cost of a software life cycle is maintenance. Almost no software is maintained by the original developer throughout its lifecycle. Coding specifications can improve the readability of soft

Java GBK, UTF-8 coding, javagbkutf-8 Coding

Java GBK, UTF-8 coding, javagbkutf-8 Coding Author: Qing Dujun Address: http://blog.csdn.net/qingdujun/article/details/41366301 1, GBK, UTF-8 Encoding Note: The default value is GBK encoding. Package io. dol. sn; import java. io. fileOutputStream; import java. io. IOExcept

Unified common coding methods and Java Web Coding

Unified common coding methods and Java Web Coding Unified format: (UTF-8 is not required, but must be unified) JSP: Servlet: Request. setCharacterEncoding ("UTF-8"); // set the input encoding format. Response. setContentType ("text/html; charsetType = gb2312"); // you can specify the output encoding format. Database :/? UserUnicode = true characterE

Java Chinese garbled solution (4) ----- java coding conversion process, java ----- java

Java Chinese garbled solution (4) ----- java coding conversion process, java ----- java The first three blogs focus on character encoding. Through these three blogs, you will have a preliminary understanding of various character encoding methods, to understand the Chinese la

Total Pages: 6 1 2 3 4 5 6 Go to: Go

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.