In Java multithreading, you can use the keyword synchronized to implement a mutex between threads. After JDK1.5, a thread concurrency library java.util.concurrent is provided to manipulate multiple threads, including java.util.concurrent.atomic and
--------------------------------------------------------------
Haven't updated the blog for a long time, today to a.
--------------------------------------------------------------
0x00 Introduction The Java RMI service is a remote method call
Test thread deadlock, run the following code:
public class Test1 {
private static Object O1 = new Object ();
private static Object O2 = new Object ();
public static void Main (string[] args) {for
(int i = 0;ipublic void Run ()
1. SOURCE Analysis Topics
Detailed introduction of the source code used in the classic design idea, to see how Daniel is writing code, improve the technical aesthetic, improve the core competitiveness.
To help you find the source of
First you need to download a javax.mail package, import the package into the project, and then go directly to the code.
Package com.javaee.email;
Import java.util.Properties;
Import javax.mail.Address;
Import Javax.mail.Message;
Import
An ordinary Java project, if you want to weave extra code into some classes, a better choice is ASPECTJ, which has the least intrusion on the project, just write a aspectj slice file, and then use the build tool to introduce the ASPECTJ plug-in
In the beginning, the program needs to manipulate the database, we will connect the database of the JDBC code into our business logic code, so that every time we connect, we must write a JDBC connection-closed code, such a writing is obviously very
Basic syntax
This includes the static, final, transient, volatile and other key words, the principle of the Foreach loop and so on. Collection
List, MAP, set implementation of the underlying implementation of the principle of class, implementation
Java memory can be divided into: heap and meta space. To View the heap:
Jmap-heap PID
View Metaspace:
Use JSTAT-GC pid mc Mu. to view other uses in the process:
The RS occupancy in top is minus the footprint in the jmap-heap.
/proc/$PID/maps Smaps
Java programming common "pit" summary (next)
30. Misuse of List
It is recommended that the following scenarios replace the list with array:
1.list length fixed, e.g. every day of the week
2. Frequent traversal of the list, such as over 1w times
3.
Java inheritance thread class creates multithreaded single-threaded samples
Example, Example01.java
public class example01{public
static void Main (string[] args) {
//Create Mythread Instance object
//Invoke the Mythread class
JAXB (Java architecture for XML Binding) is an industry standard and is a technology that can generate Java classes from XML schemas.
You can allow Java objects and XML documents to be converted to each other.
Let's say there's a pojo.
Package
After the release of Java 10, many developers have voice: Java iterations are too fast, I still stay in the Java 5,6,7,8 ... it.
In this phenomenon, jaxenter a number of Java users surveyed, collected nearly 300 of feedback, and data collation. The
Listen to Zhang Xiaoxiang: teacher about the buffer zone knowledge of the class, found that there are some do not grasp, hands-on tried, and indeed found the problem.
To start with the knowledge of the Java buffer, there is a buffer between the
1. Get the files in the SRC directory in Java engineering
Example: Get the test.properties file under the SRC directory
public class Getfilefromsrcpath
{
public static void Main (string[] args)
{
InputStream is =
in the process of reading any questions, welcome to Exchange
Email: 1494713801@qq.com
qq:1494713801
1, check out the project from SVN
SVN Co SVN address and project directory (e.g., SVN co Http://172.18.59.101/svn/svnroot/project/testpro)
2. Use
Stitching strings, roughly 3 classes can be used, they are string, Stringbuffer,stringbuilder, StringBuilder is 1.5 in place of StringBuffer. The test method is as follows:
public class Test {/** * @param args */public static void main (string[]
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