I. Introduction to the enjoy meta-modeIf you have many identical or similar objects, you can save memory by using the enjoy meta mode.Two. Key pointsThe enjoy Meta object needs to differentiate between internal and external states.Internal state:
Semaphore can control how many times a shared resource can be accessed concurrently, to maintain the number of threads currently accessing a shared resource, and to provide a synchronization mechanism. For example, control the number of concurrent
First, the demand(a) The connection of the switch is queried every five minutes;(b) The connection of each building is updated every 2.5 minutes.Second, function point
Serial number
Function Point Description
Pending
Java native methods and examples of JNI2. OverviewToday in the Java multithreaded programming, found that thread this class has a number of native methods, have never seen this method before, so for the more curious, look up some information, now
In the previous study (see the previous blog), we learned a lot of oo principles:
Package changes
Multi-use combination, less inheritance
Programming for interface/superclass, not for implementation
Loose coupling
Opening
on equals and = = in JavaWhen you are learning Java, you may often encounter the following code:1 New String ("Hello"); 2 New String ("Hello"); 3 4 System.out.println (str1==str2); 5 System.out.println (Str1.equals (str2));Why is the output
NullPointerException: null pointer exception reason: The array is no longer pointing to heap memory. You also use the array name to access the element.
For a lookup problem, if it is found, return its index value, if not found will return a
Synchronization Container class synchronization container class creationIn the early JDK, there are two kinds of ready-made implementations, vectors and Hashtable, which can be obtained directly from the new object;In JDK1.2, the synchronous
>> state transitions for threadsThe state transitions of threads are the basis of thread control, and the following image shows the state transitions of threads very visually:state transitions between threads:1. NEW: A new Thread object has been
Implementing Java to Excel file encryption with Poi-3.6-20091214.jarI used a lot of methods on the Internet, but did not succeed!Hssfworkbook wb = new Hssfworkbook (new FileInputStream (file));Set Password protection ·Wb.writeprotectworkbook ("111111
Just finished Java, in order to consolidate their knowledge and provide others with some inconsiderable help decide to open a blog, ask you to point out my mistakes, but also hope that my summary can be helpful to others.The full name of the enum is
When using Java, you will find that some objects need new, others do not, such as the math classint c = math.abs (2);If you look at the source code will be generally found that the properties and methods are static: Public Static double sin
About MapThe object that maps the key to a value. A map cannot contain duplicate keys, and each key can be mapped to at most one value. This interface supersedes the Dictionary class, which is entirely an abstract class, not an interface.The map
Refactoring: Code optimization, or you can understand the code changes!Example: Start your class name is a now change to B also known as a refactoring speciesOverloading: occurs in the same class, method names are the same , parameter lists are
Factory mode, factory mode java
Factory model classification
Simple factory ModeIs the Creation Mode of the class, also known as the static factory method mode. In simple factory mode, a factory class determines which product class to create
IDE introduction and simple use of Eclipse, ide introduction eclipse
I. IDE Introduction
① What is IDE?
1. The full name of IDE is "Integrated Development Environment ";
2. It is an application used to provide a development environment. It generally
Thread-safe List traversal: Vector, CopyOnWriteArrayList,List traversal methods
Before we talk about thread-safe List traversal, let's take a look at the methods we usually use to traverse a List.Method 1:
for(int i = 0; i Method 2:
Iterator
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