In the previous article in this series, we talked about the use of Transactionmanger and Connectionholder to complete thread-safe transaction management, in this article we will introduce template mode for transaction management.Template mode
Inheritance in Java:First, we want to understand when to use inheritance: inherited subclasses and parent classes are is-a relationships, for example: Apple is a fruit. Use fruit as the parent class, and Apple as a subclass of fruit.Inherited syntax:
Note: This article is reproduced in: http://blog.csdn.net/taxueyingmei/article/details/7697042, feel very detailed, borrowed to see, very good article.Put a picture firstThe Java stream is processed into a character stream and a byte stream. A
Declaring a method as final there are two reasons:The first is that you already know that the functionality provided by this method already satisfies your requirements, does not need to be extended, and does not allow any class that inherits from
First, Lang orderToday only found that the Java Operation Properties file is so simple, wow!Second, do not speak, first put the codeProperties prop = new properties (); InputStream FIS = FjqxIpManageServiceImpl.class.getClassLoader ().
1. Equal to the sameIf two objects have the same type and the same property value, the two objects are said to be equal (equal), and if the two reference variables point to the same object, the two variables (objects) are called the same (identical).
First, download some nice interfaces from the Internet: for example, to make a gobang, you can use the graphical interface below.Different functions are achieved by monitoring the position of the mouse (mainly obtaining coordinates).To add a mouse
In the past, little attention to memory problems, basically no attention, this aspect of the small white, because they are writing self-entertainment small program, not pay attention to performance, not to provide services. Enterprise-level
FileChannelThe FileChannel in Java NiO is a channel that connects to a file. You can read and write files through a file channel.FileChannel cannot be set to non-blocking mode, it is always running in blocking mode.Open FileChannelBefore you can use
First, there are several getresourceasstream in Java:1. Class.getresourceasstream (String Path): path does not start with '/' by default, the resource is fetched from the package where the class is located, and the '/' begins with the classpath root.
1 threads in several ways to explainThread.Sleep (long milliseconds)Sleeps the current thread for a specified amount of time, gives control to another thread, and the dormant thread still owns the lock it occupies.Thread.yield ();Pauses or discards
Java NIO OverviewJava NIO consists of the following core components:
Channels
Buffers
Selectors
Although there are many classes and components in Java NIO, in my opinion, Channel,buffer and Selector form the core API. Other
In fact, I have always felt that in the university or training institutions, one comes up to say inheritance, is very ineffective. People who have just begun to learn programming simply cannot understand the concept of inheritance. And these
1 Producer-consumer PatternProducer-consumer pattern is mainly to create a "bridge participant" between producer and consumer, to solve the mismatch between producer thread and consumer thread speed.When you want to transfer data from a thread
Use ant for remote tomcat deployment and anttomcat deployment
In the javaEE project, you need to deploy the project to a remote server. If the deployment frequency is high, manual deployment is troublesome. You can use the Ant tool for Fast
Hibernate (1) preface to hibernate
In the summary of hibernate, we need to make a rough summary with the previous relational model. The use of relational models, such as views and stored procedures, also brought a lot of convenience at the beginning
J2SE advanced-Java memory Analysis
Program Execution Process
To analyze the memory in Java, let's first take a look at the program execution process:
As shown in, there are roughly three steps:
1. At the beginning, our program exists in the
Extracts the classes. dex file from the apk file in batches.Application scenarios
If you need to analyze the apk in batches and the classes. dex file in each apk file. How to extract them? Change the suffix of apkto A. ZIP file, decompress the file,
Maven dependency, maven
Optional dependencies:
1. Which version is called? The shortest dependency Length
For example, if A-> B-> C-> D 2.0, A-> E-> D 1.0, call D 1.0.
To avoid this situation, you can directly define A-> D 2.0, that is, the
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