as possible to look concise, without losing flexibility. Not liking if/else does not mean rejecting it, the use of the time necessary, such as the function interface into the parameter check, processing abnormal branch logic flow. Usually without branching statements, I try not to use, because I think If/else is very ugly, often see If/else code, always look at it with a critical eye, think can reconstruct the better. Most of the time, on what good
ReentrantLock source code analysis for Java concurrent Series
Before Java5.0, only synchronized and volatile can be used to coordinate access to shared objects. We know that the synchronized keyword implements the built-in lock, while the volatile keyword ensures the multi-thread memory visibility. In most cases, these mechanisms work well, but cannot implement some more advanced functions. For example, the
class from a data constraint. Finally, you will see an XML schema that represents the constraints of the sample XML document.
If you have any questions about the details, please review the first article.
Build the Foundation
Now you can start creating Java classes from an XML schema. The class must accurately represent data constraints and provide a simple read and write method that the
exception again. After analyzing an exception, the code that handles the exception considers itself unable to handle it, and throwing an exception again is also an option.3. Convert the exception to another exception. In most cases, this refers to converting a low-level exception to an application-level exception (which means exceptions that are more easily understood by users ).4. Do not capture exceptions.
Conclusion 1: as exceptions are captured,
http://geek.csdn.net/news/detail/238243Original: 4 more techniques for Writing Better JavaJustin AlbanoTranslation: VincentTranslator: What would you do if you wanted to optimize the Java code you wrote now? This article describes four ways to improve system performance and code readability, and if you're interested, let's take a look. The translation is as follo
exception again. After analyzing an exception, the code that handles the exception considers itself unable to handle it, and throwing an exception again is also an option.3. Convert the exception to another exception. In most cases, this refers to converting a low-level exception to an application-level exception (which means exceptions that are more easily understood by users ).4. Do not capture exceptions.
Conclusion 1: as exceptions are captured,
Unconsciously, the project needs, have learned Java this abstruse thing. C # Review, also in the same period, but because of the project needs, we still slowly C # bar. Today is just a casual look at Java. Say less, take notesJava language and object-oriented Programming (second edition)I. Overview of object-oriented software development(a) The software developme
only 10%, so optimizing the remaining 90% of the code is a waste of time.
Based on the results of the analysis, we should start with the most common situations in order to use this knowledge. Because this will ensure that the actual effort is ultimately able to improve the performance of the system. After each optimization, the analysis steps should be repeated. Because this not only ensures that the performance of the system is really improved, but
Constant Pool Depth Profiling:In the last "https://www.cnblogs.com/webor2006/p/9416831.html" The constant pool has been analyzed to 2/3, and then the rest of the analysis, the first review of our compiled source files are:Then use Javap-verbose to view the compiled bytecode information, where the string is related to the following:The location of the binary file that applies hex fiend to view the character code
Keep an interesting code snippet in mind
Yesterday saw a very interesting question, then I saw the problem of the moment I was ignorant. In fact, their own knowledge is not solid. Now I separate it by the line of analysis, if wrong, please correct me! The main is not a solid understanding of the basic knowledge, the future will encounter a lot of problems, just a Java learning Interesting
followers, so I suggest you look at this tool, after all, it is quite popular with some people.
The benefit of using Eclipse's CheckStyle plug-in is the ability to understand the various encoding conflicts in the source context during encoding, making it more likely that developers will actually handle these conflicts before checking in the code. You can also view the CheckStyle plugin as a continu
easier it is to add new product features. Tools such as Checkstyle can help find places that can affect maintainability, conflict with coding standards, such as large classes, too long methods, unused variables, and so on.
about PMDAnother Open-source tool, called PMD, provides similar functionality as Checkstyle. I prefer Checkstyle, but PMD also has a lot of followers, so I suggest you take a look at this tool, which, after all, is quite popular
Original article: http://www.2cto.com/kf/201109/103285.html
Today is okay. Let's review the previous knowledge and find it online. I found that one article is suitable.Summary: JDK's dynamic proxy is actually a combination of reflection and dynamic bytecode generated during execution; for Spring AOP, JDK dynamic proxy is also used (cglib is also used ).The following blogs are from the Internet:I. Related Classes and methods:Java. Lang. Reflect. Pro
Objectivetoday, when I look at the Android ContentProvider implementation, I suddenly think of the Java class in the process of new, static domain, static block, non-static Domain, non-static block, constructor execution order problem. In fact, this is a very classic question, very much to explore the knowledge of Java basics. Many interviews are believed to have such problems, taking advantage of the weeke
can help you find areas that affect maintainability and conflict with coding standards, for example, too large classes, too long methods, and unused variables.
Information about PMDAnother open-source tool called PMD provides similar functions as checkstyle. I prefer checkstyle, but it also has a lot of followers, so I suggest you understand this tool. After all, it is also favored by some people.
The advantage of using the checksty
a classic in multi-threaded programs. In this source code, we will use the wait, policy, and policyall of Java. Lang. object to implement this model. This is the most important thing.Before getting started, let's familiarize ourselves with the game rules of the producer-consumer model:1. production is not allowed when the Warehouse is full;2. Empty data cannot be consumed;3. Before a consumer consumes a pr
Recently, the machine memory is full again. In addition to the new machine memory, we should also review our code. Many code compilation methods are too casual, these bad habits or lack of understanding of the programming language should be well suppressed.
The following is a summary of some of the network resources that should be done as much as possible in
Recently, in a systematic review of the knowledge of Java virtual machines, there is an interesting question: What is the type of Boolean in virtual machines?
To answer this question, we look at the JDK source code is not able to solve the source code, we must go deep into the class file to solve the problem. So he g
Illustration of Java IO: 1. File source code, iofile
Writer: BYSocket)
Weibo: BYSocket
Bean flap: BYSocket
FaceBook: BYSocket
Twitter: BYSocket
I remember that the Java source code was first read by the set. I wrote a series of articles related to the set, which was well evaluated. Thank you. I will still read the old
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.