One, test int is thread unsafe
In Java, in the case of high concurrency/multithreading, the self-subtraction of int is not thread-safe, and the use of Atomicinteger can be guaranteed.
Package com.yezi.learn.atomic;
Import
The citizenship number is a characteristic combination code, which consists of a 17-digit ontology code and a digital parity code. Order from left to right is: six-digit address code, eight-digit birth date code, three-digit numeric sequence code
Red Flag Linux,java Platform, xstream components, XStream produce utf-8 format files, sometimes rows, sometimes reported utf-8 format errors, and finally found that using different terminals to log on to Linux and start Tomcat will have different
Define interface://deque.java package DSA; Depending on the location of your program public interface Deque {public int getsize ();//Returns the number of elements in the queue public Boolean isempty ();//Determine if the queue is empty public Obj
Public interface Stackinterface {public
Boolean isempty ();
public boolean isfull ();
Public boolean push (object);
Public Object pop ();
Public Object Peek (); Get stack top element
}
public class Javastack implements Stackinterface
Because the Java environment variable is configured with JDK1.5.0_17, the 1.6.0_22 information appears when you run Java-version.
Based on the above information to guess before not completely uninstall the 1.6.0_22 of the directory, so go to see the
Java Container class and traversal efficiency comparison
1) Collection
Collection is the most basic set interface, and a collection represents a set of Object,java SDKs that do not provide a class that directly inherits from collection, and the
Chapter II Concurrent access to objects and variables
This section summarizes some of the synchronized usage methods:
In Java: "Non-thread-safe" issues exist in "instance variables", and if they are private variables within a method, there is no
Excerpt from Donkeyzheng's BlogFirst, prepare the article
Q1.1 What is Java, Java2, JDK. What happened to the 1.3, 1.4 version number behind the JDK.A: Java is a generic, concurrent, strongly typed, object-oriented programming language (excerpt from
Very early know the principle of the crawler, but has not been implemented, today, write up really encounter a lot of difficulties, especially the problem of multithreading synchronization. Or they are not familiar with multithreading, there is no
First of all assume a scene, such as we are selling mobile phones, if customers come to pick a mobile phone, need to take a different type of mobile phone to demonstrate the function
For simplicity, we can make an interface that connects to the
In the Java language Specification, a method's characteristics include only the name of the method, the number and type of parameters, and not the return type of the method, the name of the parameter, and the exception thrown out. When the Java
Method
38th: Check the validity of the parameters
Check the parameters at the beginning of the method body, and for public methods, use the @throws tab of Javadoc to describe the exception that is thrown when the parameter value limit is violated
The application of WebService has become more and more extensive, and here are some ways to develop webservice in the Java system, which is equivalent to making a record.
1.axis2
Axis is the next open source WebService development component of
Today, remote FTP suddenly hung up, resulting in reading FTP remote files of the program zombie thread. The check found that the code did not judge timeout exceptions. has now been modified as follows.
/** * The remote file is temporarily written
This article on the basis of the original text to be modified, please refer to the original:
http://titanseason.iteye.com/blog/1471606 because this blog does not support attachment attachments please download here
http://my.oschina.net/bigyuan/blog/1
In Java, a Java class will be compiled into a class file. At compile time, the Java class does not know the actual memory address of the reference class, so only symbolic references can be used instead. For example, the Org.simple.People class
public static void Main (string[] args) {
//TODO auto-generated method Stub
Integer a = new integer (1);
Integer b = new integer (1);
int c=1;
Integer e = 1;
System.out.println ("A==b:" + (a==b));
System.out.println ("A==c:" + (A==c));
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