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
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
:
Design a parking garage.
Design a bank of elevators in a skyscraper.
Model the monorail system at Disney World.
Design a restaurant-reservation system.
Design a hotel room-reservation system.
A good OO design question can test coding, design, domain knowledge, oo principles, and so on. A good weeder question showould probably just target whether they know when to use subtypes, attributes, and containment.
Example Data Structure
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
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
-16be, UTF-16, and Unicode are the same.
about UTF-8:
UTF-8 encoded file, its file also has a section logo: EF BB BF
Other encodings:
Other encoded files. Its file header does not have any marking, regarding iso-8859-1 to "China" The code is 3f,3f, two identical, is should for its character set does not have "China" These two words, therefore uses the 3F to replace.
coding and decoding problems in Java:
requires determining that as many containers as possible are loaded into the ship without the loading volume being limited.Solution: Each time the weight of the lightest person.Huffman Code:For shorter characters with high frequency, the characters with lower frequency appear with longer encoding. A 0,1 string is specified for each character as its code, and the code that requires either character is not prefixed with any other character code. This encoding is called a prefix code.The above fou
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
Java Chinese garbled solution (6) ----- coding and decoding in java Web, java ----- javaWeb
In the previous blog, LZ introduced the java encoding and decoding operations in the previous two scenarios (IO and memory, in fact, in these two scenarios, we only need to set the co
Article 3: JAVA character encoding Series 3: coding problems in Java applications this part adopts the reuse mechanism and references an article to complete this part. Source: Eceel Research -- character set encoding address: http://china.eceel.com/article/study_for_character_encoding_java.htm
1. Overview
This article mainly includes the following aspects: Basic
By using some assistive tools to find bottlenecks in the program, you can then optimize the code in the Bottleneck section. There are generally two scenarios: optimizing code or changing design methods. We generally choose the latter because it is better to improve the performance of the program than to call some optimized code without calling the following code. A well-designed program can streamline the code and improve performance.Here are some of the methods and techniques that are often use
system's file.encoding parameter (it is the operating system default encoding format, such as Win2K, which has a value of GBK), then the JDK translates our Java source program into memory from the file.encoding encoded format into the Java internal default Unicode format. And then Javac compiles the converted Unicode file into a. class file, at which point the. class file is Unicode encoded, it is temporar
1. Naming rules1.1 package naming rules
[Java-1]The package name should be written in small form and separated by "." In the middle [required]
Description · reason
Unless otherwise specified, make sure that the package name is written in small form. This is a general Java rule.
Example
Package CN. co. AAA. BBB; // ErrorPackage CN. co. AAA. BBB; // correct
[
Summary of Java back-end development interview questions of major companies, and java back-end interview questions
ThreadLocal (thread variable copy)
Synchronized implements Memory sharing. ThreadLocal maintains a local variable for each thread.
It uses space for time, which is used for data isolation between threads
Java file encoding tool and java coding Tool
This article mainly introduces a tool class written in java to convert a file encoding to another encoding that does not change the file content:
You can use URLEncoding to re-encode and decode the source file.
1 public class ChangeFileEncoding {2 public static in
circumstances to 8 screen around to display. This makes it difficult to read a program or modify a program. It is therefore advisable to extract the block that completes the comparison of independent functions as a single function. A block that accomplishes the same or similar function is extracted independently of a sub-function. It can be found that the simpler the upper-level function is, the more specific work is done by invoking a few sub-functions, the more the underlying function complet
Coding | Problems Java language default encoding is Unicode, and we Chinese commonly used files and databases are based on GB2312 or BIG5 encoding, how to properly select the encoding method and correctly handle the Chinese character encoding? This article will start with encoding common sense, combine Java programming example, analyze above two
Java learning path-simple basic interview questions, java path-Questions
1. What are the features of object orientation?
A: The object-oriented features mainly include the following:
1) Abstraction: Abstraction refers to the process of summarizing the common features of a class of objects to construct classes, includin
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.