Definition: The responsibility chain model (Chain of responsibility pattern) creates a chain of recipient objects for the request. This pattern gives the type of the request, decoupling the sender and receiver of the request. This type of design
definition: an element that is used sequentially to access a collection object without knowing the underlying representation of the collection object.
Characteristics:
1. It supports traversing an aggregation object in a different way.
2, the
Read the introductory content of an article (that is, the first 200 characters) when it was developed a while ago. Using a hidden field, maybe someone will ask, that backstage is also can intercept characters ah, that is because the editor contains
As we all know, Java provides a lot of ways to intercept strings. Here's a look at roughly a few.
1.split () + regular expression to intercept.
The regular is passed in Split (). Returns a string array type. However, interception in this way can
Length,length () in Java, size () difference
Length property: Used to get the length of the array.
eg
int ar[] = new int{1,2,3}
/**
* Array with the Length property to get the lengths/
int lenar = ar.length;//here lenar=3
System.out.println
Copy Code code as follows:
public class Testcyclicbarrier {
private static final int thread_num = 5;
public static class Workerthread implements runnable{
Cyclicbarrier barrier;
Public Workerthread (Cyclicbarrier b) {
This.barrier =
Copy Code code as follows:
public class Test {
public static void Main (string[] A RGS) {
//logical operators perform short-circuit evaluation, and when the left-hand operand can infer the value of an expression, the
Copy Code code as follows:
Package com.gpdi.action;
Import java.util.ArrayList;
Import java.util.Collections;
Import Java.util.HashMap;
Import java.util.List;
Import Java.util.Map;
public class Wordsstatistics {
Class OBJ {
int
Recently in the code optimization to learn and study the use of Java multithreading, read the rookie's opinion after doing a summary.
1, inheritance thread class to achieve multithreading
Methods that inherit the thread class although I am listed
The demo here is an additive algorithm, such as 1,2,3,4.....N
That is: sum = 1+2+3+4......+n;
We can do this:
Copy Code code as follows:
/**
* Cyclic implementation of the cumulative method
* @param value
* @return
*/
Final can modify classes, member variables, local variables, and methods.
1.final Modifier member Variable
Initialization of a 1.final member variable
For final-decorated variables, the system does not initialize to 0 by default
Fina Variable
A complete Java application that usually has at least one end point for the application. For a general program, the system developer ends the program at the end of the program by adding System.exit (0), or System.out (-1), depending on the needs and
Recently in doing school curriculum design, Java programming needs to use the dialog box pop-up, the first response is JS in the alert and confirm,java words of the moment Meng, consulting learning summarized as follows, for later learning
1.
Message Digest algorithm MD5, a hash function widely used in the field of computer security, is a commonly used hashing algorithm, the fifth edition of the Chinese Word Digest algorithm.
Java can be implemented in two ways, we first say a little
Start () boot thread method
When run () invokes the Start () method, the method body of the method is actually executed
Sleep () wakes the current thread, sleeps automatically, and enters the operational state rather than the running state
Yield (
Static loading:
Package COM.IMOOC. Loading class;
public class Office_static {public
static void Main (string[] args) {
//new Create object, is statically loaded class, need to load all possible classes at compile time
if ("word".
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