Discover java coding best practices, include the articles, news, trends, analysis and practical advice about java coding best practices on alibabacloud.com
This article is the third of the GC expert series. In the first understanding of Java garbage Collection, we learned several different GC algorithm processing processes, the way GC works, the difference between the new generation and the old age. So, you should have known about the 5 GC types in JDK 7, and the performance impact of each GC.The second monitoring of Java garbage collection describes how the J
PHP core technology and best practices PHP uses PHPRPC protocol to call JAVA class
SOAP (Simple Object Access Protocol, Simple Object Access Protocol) with the continuous competition and design of manufacturers, and because the transfer of objects cannot achieve interoperability, SOAP gradually changes to the transfer of strings, and is finally designed as the XML-based WebService.
PHPRPC protocol: it
It has been 10 years since I started to contact Java to learn such a classic program as helloworld.
I heard a lot of lectures from Daniel and saw the high programming speed on the keyboard.
Was shocked. When programming becomes more and more physical, we can still have our own ideas, but also cultivate for the Java System Level
Programmer? Learn and cultivate the following knowledge and skills to help you r
Java Web concurrency: for update practices, monitoring and solving ., Javawebupdate
Writer: BYSocket)
Weibo: BYSocket
Douban: BYSocket
I. Preface
We have been talking about concurrency. At present, there are two common practices: Lock Mechanism: 1. pessimistic lock; 2. Optimistic lock.
However, this article is mainly used to record my processing experience. In ad
Java coding SummaryI. Principles of practice1. Save the page file in the same format as the statement.If you declare 2. Whether it is get, post or Javascript, the browser submits the request in the encoding format specified by the page file.3. Javascript methods such as encodeuri and encodeuricomponent use UTF-8 format to encode dataIi. HTTP and Servlet specificationsA. http protocol1. Get according to the
software system structure.The tighter the connection between the modules, the stronger the couplingThe module's independence is worse.The coupling between modules depends on the complexity of the interface between modules, the mode of invocation and the information transmitted. Coupling and cohesion are the two qualitative standards of module independence, when the software system is divided into modules, it is possible to achieve high cohesion and low coupling, improve the independence of mod
The IDE I'm using is idea, and the places where eclipse may be set up are different1. Encoding of source filesWhen writing. java files in various Ides, there is an encoding that the IDE stores files on the machine in this encoding format, such as my settings, to set the S.java file to GBK format2. At compile time, Javac will read the file in the specified encoding format and then compile it into Unicode format.For example, I joined encoding GBK this s
1. Preface
Java application is a very common problem, how to read the Jar/war package and the path of the configuration file, different people according to different practices summed up the different scenarios, but others application will be due to the environment and other differences to find a variety of problems, this article from the principle of interpretation of best practice.
2. Referen
Do you think you are a Java expert? Are you sure you have fully mastered the Java exception handling mechanism? In the following code, can you quickly find the six problems for exception handling?OutputStreamWriter out =...Java. SQL. Connection conn =...Try {// retryStatement stat = conn. createStatement ();ResultSet rs = stat.exe cuteQuery ("Select uid, name fro
It has been 10 years since I started to contact Java to learn such a classic program as helloworld.
I heard a lot of lectures from Daniel and saw the high programming speed on the keyboard.
Was shocked. When programming becomes more and more physical, we can still have our own ideas, but also cultivate for the Java System Level
Programmer? Learn and cultivate the following knowledge and skills to help you r
StringBuilder instead of string objects at the right time, single-threaded using StringBuilder, stringbuffer in multithreaded situations.
Allocate StringBuffer, arrays, array,vector and other capacities in advanceFor objects that need to be allocated continuously, it is better to allocate the capacity ahead of time, generally the default initial capacity is relatively small, such as the capacity of StringBuffer is only 16, if the default capacity is easy to reallocate after the full capacity
Java and JavaScript Base64 encoding
When developing Java Web applications, it is possible to use Java for BASE64 encoding on the server side, while the client can decode it with JavaScript. This requires consistency of Base64 coding mechanisms on both sides.
Using BASE64 encoding, you may encounte
Do you think you are a Java expert? Are you sure you have a complete grasp of the Java exception handling mechanism? In the following code, can you quickly identify six problems with exception handling?
1 OutputStreamWriter out = ...
2 Java.sql.Connection conn = ...
3 try {//⑸
4 Statement stat = Conn.createstatement ();
5 ResultSet rs = Stat.executequery (
6 "Select UID, name from user");
7 while (Rs.next (
Atitit. Implementing best practices for extracting Zip files Java C #. NET PHP
1. JDK zip with Apache ant zip 1
2. Apache ant package for zip file compression, upzip approximate process. 1
3. Read the file name OK, but cant read to input said Npe. 2
4. Ant1.8.2.jar 2
5. #---Details Code 2
6. Reference 4
1. JDK zip with Apache ant zip
The following function is to extract the image files in th
the Observer class, the only way to implement the Observer Interface update
void Update (Observable o, Object Arg)
The parameter, object arg, corresponds to an argument passed by Notifyobservers (object Arg), and when the Notifyobservers () is executed, ARG is null. A simple example is given below: PackageDesignpattern_observer;Importjava.util.Observable; Public classMybuttonobserableextendsObservable {PrivateString Clickmode; PublicString Getclickmode () {returnClic
of out-of-heap memory.Here are some practical experiences, in addition to the Java heap and the permanent generation of memory:Direct Memory: Can be resized by-xx:maxdirectmemorysize and thrown OutOfMemoryErroror Outofmemoryerror:direct buffer memory.Thread stacks: Can be resized by-XSS and thrown stackoverflowerror when out of memory (cannot be allocated vertically, i.e. new stack frames cannot be allocated)Socket buffers: Each socket connection is
will reveal the internal work and failure of the application, which can be used by attackers to further attack the application. Therefore, we need to treat the logs with care and keep them safe. Information that should not be logged is as follows:
Credit card number
Social Security Number
Password
However, the following types of information should not be written to the log:
Session identifiers
Authorizing tokens
Personal name
Phone number
Informati
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.