Java Desktop Program GUI programming has been criticized. It seems that people have always thought that Java can not develop a friendly interface. Its rubbish levels seem to remain at the beginning of the graphics operating system. It all seems to
1. Create base class
In a project, we often have to build a base class of entity classes with common methods to improve code reuse.Suppose each table has field IDs and username, and each table requires a similar crud method (such as checking XX
Atomicboolean can have one thread wait for another thread to complete the task before executing it:
A Boolean value is updated atomically. The Java.util.concurrent.atomic package specification for description of the properties of atomic variables.
One. Java Thread Synchronization principle
Java assigns a monitor to each object object, and when a synchronization method (synchronized methods) is invoked by multiple threads, the object's monitor will handle the concurrent exclusive requirements
Activiti background is supported by the database, and all tables begin with Act_. The second section is a two-letter identifier that represents the purpose of the table. The purpose also corresponds to the API of the service.
1) act_re_*: ' RE '
This problem is due to the inability to find the appropriate DNS resolution, there are several ways to solve.
1. Add a row to the Windows\system32\drivers\etc\hosts
202.181.254.101 http://xxx.xxx.com
This method only solves the problem temporarily
JDBC Connection Database
• Create a program that connects the database with JDBC, which contains 7 steps:
1. Load JDBC Driver:
Before you connect to a database, you first load the drive to the JVM (Java Virtual Machine) of the database you want to
Use the stream example in Java 8 to sort a Map by keys or values. 1. Quick Start
In Java 8, follow this procedure to sort the map. Convert Map to Stream sort it Collect and return a new Linkedhashmap (keep order)
Map result = Map.entryset (). Stream
There are eight basic types of Java, the basic types can be divided into three categories, character type char, Boolean and numeric type Byte, short, int, long, float, double. Numeric types can also be divided into integer type Byte, short, int,
The Java Read Properties configuration file code is as follows:
String Path = System.getproperty ("User.dir") + "\\properties\\config.properties";
Properties Pro = new properties ();
FileInputStream in = new FileInputStream (path);
Pro.load
The following content is translated from the mat help document.
Mat Download Address http://www.eclipse.org/mat/One, Class histogram
Class histogram shows the classes found in the snapshot, the number of objects to each class, the heap memory
HashMap, Hashtable difference.1, HashMap thread is unsafe, hashtable thread safety;2, HashMap the keys and values are allowed to exist null values, and Hashtable not allowed;3, HashMap efficiency is higher than Hashtable* Hash table based
1. Static proxy class and dynamic proxy class differencesstatic proxy : The proxy class and the proxy class are required to implement the corresponding set of interfaces at the same time, through the proxy class to invoke the method of overriding
Object Objects
Let's start by introducing the APIAPI (Application programming Interface): Application Programming InterfaceJava API
is the class that Java provides to us, these classes encapsulate the underlying implementation.
We
This is the string class above the comments, I use Google Translate, although a bit of grammatical problems, but probably can be translated/** * The {@code String} class represents character strings. All * strings literals in Java programs, such as
And the atomic class in the contract can solve the atomic problem of the compound class operation like num++, compared with the lock mechanism, the use of atomic class is more compact and lighter, and the performance cost is smaller, the following
Between Java and C + + there is a "high wall" of memory management and garbage collection technology, people outside the wall want to go in, the wall people want to come out. ------from the in-depth understanding of Java virtual machinesAs a Java
There are three ways to get class objects in Java1.getClass (); But the downside is that if there is no class, it will go wrong and compile2.class.forname ("Package + Class");//If there are no classes, this method will not error, but will run with
Wait () notify () Notifyall ( ) These 3 methods are used to coordinate the access of multiple threads to shared data, so they must be used in the synchronized statement block. Wait () must be inside the synchronized function or code block, and wait
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