A previous project started with bio, or block Io, and then replaced bio with NIO, or non-blocking IO, because of some performance issues.Let's talk about what's the downside of bio. Why use NiO:Use TCP in Java as an example to explain:We know that
Normal threadThis is the most common, create a thread, and then let it run in the while loop, through the sleep method to achieve the effect of a timed task. This can be implemented quickly and easily, with the following code:
JMX (Java Management Extensions, or Java Management Extensions) is a framework for embedding management functions for applications, devices, systems, and so on. JMX can flexibly develop seamlessly integrated systems, network, and service management
Need Jxl.jar PackageCom.rainmer.main;ImportJava.io.File;Importjava.io.IOException;Importjava.util.ArrayList;ImportJXL. Cell;ImportJXL. Sheet;ImportJXL.
1. DefinitionAn inner class is a class that is defined inside a class body, and the inner class is compiled into Outerclass$innerclass.class by the compiler.class outerclass{ privateint value; class innerclass { }}2. Features(1)
Title:Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:
The left subtree of a node contains only nodes with keys less than the node ' s key.
The right subtree of a node contains
Topic:Given a binary tree, return the level order traversal of its nodes ' values. (ie, from left-to-right, level by level).For example:Given binary Tree {3,9,20,#,#,15,7} , 3 / 9 / 7Return its level order traversal as:[ 3], [9,20], [1
I. Custom annotation ClassesTarget limits the scope of use of annotationsTYPE,For classes, interfaces, enumerations, but not annotationsFIELD,field, including the enumeration valueMETHOD,methods, not including construction
1th: Consider replacing the constructor with a static factory method"Not thoroughly read the author's intentions"2nd: Consider using constructors when multiple constructor parameters are encountered1. Using overlapping constructors: The disadvantage
Original link: http://coolxing.iteye.com/blog/1236909Two types of mutex mechanisms:1, synchronized2, ReentrantlockReentrantlock is a new feature of Jdk5, the use of Reentrantlock can completely replace the replacement synchronized traditional
Reprint please specify the source http://blog.csdn.net/l1028386804/article/details/46970705A snippet of code from Google Maps's script will probably be used. Let's see how it all counts.Private static final Double Earth_radius = 6378.137;private
Design Pattern _ responsibility chain patternDefinitionAvoid coupling the sender of a request to its own er by giving more than one object a chance to handle the request. chain the processing objects and pass the request along the chain until an
Summary of the traversal of the Map set and the summary of the map set
The traversal of a Map set is often encountered. Today we will summarize several methods of traversing a Map set:
1 public static void main (String [] args) {2 Map map = new
Java series Learning (14th)-set, java series set
1. Set learning in java
2. Common Methods in Collection
1. Add features BooleanAdd(E): Add an element. BooleanAddAll(Collection c): Add a set. 2. Deletion VoidClear(): Removes all
Conversion of strings into numbers and precautions
Convert a string to a number:
Atoi, atol, and atoll are required for Signed Conversion. Use strtoul and strtoull for unsigned conversion.
(1) Common conversion functions
Converted to signed:
#
Java annotation + reflection Application Record, javaannotation
A small example of annotation and reflection in java is recorded for reference,
The configuration page allows you to dynamically select a class that implements the Check interface, save
Design Pattern _ builder PatternBuilder PatternSeparate the construction of a complex object from its representation so that the same construction process can create different representations. separates the construction of a complex object from its
Design Pattern _ template method patternTemplate Method PatternDefine the skeleton of an algorithm in an operation, defering some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the
Command mode in Design Mode
Four roles:
Receiver: The command is finally passed here to execute the command, but multiple commands can be executed.
Command: Has a pointer to the worker er. You need to execute a Command
Invoker: Record and trigger
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